public function pageList($p, $z) { $table = DbObject::_getTableSchema($this->class); $objects = DbObject::_find($this->class, $this->conditions, array('orderby' => $this->orderby . ', id')); $this->assign('table', $table); $this->assign('objects', $objects); }
public function pageData($p, $z) { header('Content-type: text/xml'); $this->layout = 'plain'; $entries = DbObject::_find('Entry'); $this->assign('entries', $entries); }
public function getPermittedRequests() { if ($this->id == self::rootId) { $requests = DbObject::_find('Request', NULL, array('orderby' => 'id')); } else { $requests = $this->request; } return $requests; }
public function pageDestroy() { // you shouldn't really do stuff like this in a page function $all = DbObject::_find('PersonStuff'); foreach ($all as $thisObject) { $thisObject->destroy(); } $all = DbObject::_find('GuidPerson'); foreach ($all as $thisObject) { $thisObject->destroy(); } }
function pageList($p, $z) { $people = DbObject::_find('Person'); $this->assign('people', $people); }
public function pageDefault($p, $z) { $entries = DbObject::_find('Entry'); $this->assign('entries', $entries); // echo_r($entries); }
public function postBoard() { $boards = DbObject::_find('Board', array('name' => 'default')); $board = $boards[1]; $board->saveCells($_POST['cell']); Redirect(virtual_url); }
/** * Retrieve one object from the database and map it to an object. Throws an error if more than one row is returned. * * @param string $className The name of the class corresponding to the table in the database * @param array $conditions Key value pair for the fields you want to look up * @return DbObject */ public static function _findOne($className, $conditions = NULL, $params = null) { $a = DbObject::_find($className, $conditions, $params); if (!$a) { return false; } assert(is_array($a)); if (count($a) < 1) { return false; } if (count($a) > 1) { trigger_error("one row was requested but " . count($a) . " were returned"); } return current($a); }
/** * Retrieve one object from the database and map it to an object. Throws an error if more than one row is returned. * * @param string $className The name of the class corresponding to the table in the database * @param array $conditions Key value pair for the fields you want to look up * @return DbObject */ public static function _findOne($className, $conditions = NULL) { $a = DbObject::_find($className, $conditions); if (!$a) { return false; } assert(is_array($a)); assert(count($a) == 1); return current($a); }