コード例 #1
0
 /**
  * @param $obj
  * @return array
  */
 public function toArray($obj)
 {
     return $this->mapper->toArray($obj);
 }
コード例 #2
0
ファイル: Outlet.php プロジェクト: jimmydivvy/outlet-orm
 /**
  * Parse a query containing outlet entities and return a PDOStatement (not executed)
  * 
  * @param string $query
  * @return PDOStatement
  */
 public function prepare($query)
 {
     $q = OutletMapper::processQuery($query);
     $stmt = $this->con->prepare($q);
     return $stmt;
 }
コード例 #3
0
 /**
  * Populate an object with the values from an associative array indexed by column names
  * 
  * @param object $obj Instance of the entity (probably brand new) or a subclass
  * @param array $values Associative array indexed by column name, it must already be casted
  * @return object populated entity 
  */
 public function populateObject($obj, array $values)
 {
     foreach ($this->props as $key => $f) {
         if (!array_key_exists($f[0], $values)) {
             throw new OutletException("Field [{$f['0']}] defined in the config is not defined in table [" . $this->table . "]");
         }
         $this->setProp($obj, $key, OutletMapper::toPhpValue($f[1], $values[$f[0]]));
     }
     return $obj;
 }
コード例 #4
0
 static function clearCache()
 {
     self::$map = array();
 }