Skip to content

Instantly share code, notes, and snippets.

View lucvht's full-sized avatar

lucvht

  • Belgium
View GitHub Profile
@lucvht
lucvht / gist:4941a44104bbb67559d9
Created November 20, 2014 14:10
redbean NUMERIC support for postgresql
class NumericWriter extends \RedBean_QueryWriter_PostgreSQL implements \RedBean_QueryWriter{
const C_DATATYPE_NUMERIC = 10;
public function __construct(\RedBean_Adapter $adapter ) {
parent::__construct( $adapter );
$this->typeno_sqltype[self::C_DATATYPE_NUMERIC] = ' numeric ';
$this->sqltype_typeno[trim(' numeric ')] = self::C_DATATYPE_NUMERIC;
}
}
<?php
class BaseModel extends \Phalcon\Mvc\Model {
private function checkRelationsCommon($operation,$fields,$referenceModel, $referencedFields) {
$feedback = [];
if (!property_exists($this,$fields)) {
$feedback[] = "Cannot find field " . get_class($this) . "->${fields} used by ${operation} in Object " . get_class($this);
}