/** * Populates the object from passed row dataset * @param array $row Single row from a SQL query */ public function populateFromRow($row) { $this->id = getColumnValue($row, "tagID"); $this->name = getColumnValue($row, "tagName"); $this->value = getColumnValue($row, "tagName"); $this->parentID = getColumnValue($row, "tagParentID"); }
/** * [getDropDownOptions description] * @method getDropDownOptions * @param [type] $tableName [description] * @param [type] $valueColumn [description] * @param [type] $nameColumn [description] * @param string $orderBy [description] * @return [type] [description] */ function getDropDownOptions($tableName, $valueColumn, $nameColumn, $orderBy = "") { $sql = "SELECT {$valueColumn} as id, {$nameColumn} as name FROM {$tableName} {$orderBy}"; $dataset = execPDO($sql); $arr = array(); foreach ($dataset as $row) { $obj = new \GeniusFactor\Fibr\BaseObjects\GFKeyPair(); $obj->id = getColumnValue($row, "id"); $obj->name = getColumnValue($row, "name"); $obj->value = $obj->id; $arr[] = $obj; } return $arr; }
/** * [getColumnValueAsDateTime description] * @method getColumnValueAsDateTime * @param [type] $row [description] * @param [type] $columnName [description] * @param [type] $debugMode [description] * @return [type] [description] */ public static function getColumnValueAsDateTime($row, $columnName, $debugMode = false) { return new \DateTime(getColumnValue($row, $columnName, $debugMode)); }