/** * @param $obj * @return array */ public function toArray($obj) { return $this->mapper->toArray($obj); }
/** * 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; }
/** * 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; }
static function clearCache() { self::$map = array(); }