本文整理汇总了PHP中self::fetchAll方法的典型用法代码示例。如果您正苦于以下问题:PHP self::fetchAll方法的具体用法?PHP self::fetchAll怎么用?PHP self::fetchAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类self
的用法示例。
在下文中一共展示了self::fetchAll方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getUsers
public static function getUsers()
{
$userModel = new self();
$select = $userModel->select();
$select->order(array('last_name', 'first_name'));
return $userModel->fetchAll($select);
}
示例2: _setup
/**
* Все таблицы для хранения данных имеют префикс
*
*/
protected function _setup()
{
parent::_setup();
$this->_cleanName = $this->_name;
$this->_name = self::PREFIX_TABLE . $this->_name;
if (false == array_key_exists($this->_cleanName, self::$setupedTables)) {
$modelFields = new Modules_Publications_Model_Fields();
$this->_tableProfile = $modelFields->fetchAllByTableName($this->_cleanName);
foreach ($this->_tableProfile as $row) {
if ($row->list_values) {
if (false == array_key_exists($row->list_values, self::$linkedData)) {
if ('routes' == $row->list_values) {
self::$linkedData[$row->list_values] = Modules_Router_Model_Router::getInstance()->getRoutesTreeHash();
} else {
$model = new self($row->list_values);
self::$linkedData[$row->list_values] = $model->fetchAll()->toArray();
}
}
self::$linkedFieldsTableData[$this->_cleanName . '_' . $row->name] = self::$linkedData[$row->list_values];
}
}
self::$setupedTables[$this->_cleanName] = $this->_tableProfile;
} else {
$this->_tableProfile = self::$setupedTables[$this->_cleanName];
}
}
示例3: getTypes
public static function getTypes()
{
$Type = new self();
$Types = $Type->fetchAll(null, "Type");
if ($Types) {
return $Types->toArray();
} else {
return array();
}
}
示例4: getDomainModel
/**
* Returns the topics table as a domain model.
* STAGE 3: Choose, create, and optionally update models using business logic.
* The domain model can be manipulated later by controllers.
* @return array of topic row set objects indexed by topic id
*/
public static function getDomainModel()
{
if (self::$_domainModel === null) {
$topicsTable = new self();
$rowset = $topicsTable->fetchAll(1, 'modification_time');
foreach ($rowset as $row) {
self::$_domainModel[$row->topic_id] = $row;
}
}
return self::$_domainModel;
}
示例5: getMapMultiOptions
/**
*
* get multi Options country for google map
*/
public static function getMapMultiOptions()
{
$t = new self();
$select = $t->select()->where('status= 1')->order('name');
$result = array();
$result[''] = '';
foreach ($t->fetchAll($select) as $item) {
$result[$item->name] = $item->name;
}
return $result;
}
示例6: getPageAlbums
public static function getPageAlbums($IDPage)
{
$Ret = array();
$A = new self();
$Albums = $A->fetchAll("IDParent = '{$IDPage}' AND Extension IS NULL", 'Title');
if ($Albums) {
foreach ($Albums as $Album) {
$A = new self();
$Ret[] = $A->copyFromDb($Album);
}
}
return $Ret;
}
示例7: fetchAllRecords
public static function fetchAllRecords($quiz_id)
{
$self = new self();
$constraints = array(array("mode" => "AND", "key" => "quiz_id", "value" => $quiz_id, "method" => "="));
$objs = $self->fetchAll($constraints, "=", "AND", $self->default_sort_column, $sort_order);
$output = array();
if (!empty($objs)) {
foreach ($objs as $o) {
$output[] = $o;
}
}
return $output;
}
示例8: fetchAllRecords
public static function fetchAllRecords($qquestion_id, $response_active = 1)
{
$self = new self();
$constraints = array(array("mode" => "AND", "key" => "qquestion_id", "value" => $qquestion_id, "method" => "="), array("mode" => "AND", "key" => "response_active", "value" => $response_active, "method" => "="));
$objs = $self->fetchAll($constraints, "=", "AND", $sort_col, $sort_order);
$output = array();
if (!empty($objs)) {
foreach ($objs as $o) {
$output[] = $o;
}
}
return $output;
}
示例9: getNew
public static function getNew($IDParent, $lastID)
{
$TheChat = new self();
$Messages = $TheChat->fetchAll("IDParent = '{$IDParent}' AND IDChat > {$lastID} AND Date + INTERVAL 20 MINUTE > NOW()", "Date");
$Ret = array();
if ($Messages) {
foreach ($Messages as $Message) {
$TheChat = new self();
$Ret[] = $TheChat->copyFromDb($Message);
}
}
return $Ret;
}
示例10: getPhotosByAlbum
public static function getPhotosByAlbum($IDAlbum)
{
$ThePhoto = new self();
$Photos = $ThePhoto->fetchAll("IDParent = '{$IDAlbum}' AND Extension IS NOT NULL");
$Ret = array();
if ($Photos) {
foreach ($Photos as $Photo) {
$ThePhoto = new self();
$Ret[] = $ThePhoto->copyFromDb($Photo);
}
}
return $Ret;
}
示例11: fetchAllRecords
public static function fetchAllRecords($status = "open")
{
$self = new self();
$constraints = array(array("mode" => "AND", "key" => "status", "value" => $status, "method" => "="));
$objs = $self->fetchAll($constraints, "=", "AND", $sort_col, $sort_order);
$output = array();
if (!empty($objs)) {
foreach ($objs as $o) {
$output[] = $o;
}
}
return $output;
}
示例12: fetchAllByDraftID
public static function fetchAllByDraftID($draft_id = 0)
{
$self = new self();
$constraints = array(array("mode" => "AND", "key" => "draft_id", "value" => $draft_id, "method" => "="));
$objs = $self->fetchAll($constraints, "=", "AND", $sort_col, $sort_order);
$output = array();
if (!empty($objs)) {
foreach ($objs as $o) {
$output[] = $o;
}
}
return $output;
}
示例13: getConversation
public static function getConversation($IDMessage)
{
$TheMessage = new self();
$Select = $TheMessage->select()->join(array('mm' => 'message'), 'message.IDParent = mm.IDParent', array())->where("mm.IDMessage = '{$IDMessage}'")->order("mm.Date");
$Messages = $TheMessage->fetchAll($Select);
$Ret = array();
if ($Messages) {
foreach ($Messages as $Message) {
$TheMessage = new self();
$Ret[] = $TheMessage->copyFromDb($Message);
}
}
return $Ret;
}
示例14: getPosts
public function getPosts($Start = 0, $Limit = self::POSTS_LIMIT)
{
$TheForum = new self();
$Posts = $TheForum->fetchAll("IDParent = '" . $this->IDForum . "' AND IsForum = '0'", "DateLastModify", $Limit, $Start);
$Ret = array();
if ($Posts) {
foreach ($Posts as $Post) {
$TheForum = new Zwe_Forum_Message_Post();
$TheForum->copyFromDb($Post);
$Ret[] = $TheForum;
}
}
return $Ret;
}
示例15: getComments
public function getComments($Start = 0, $Limit = self::COMMENTS_LIMIT)
{
$TheForum = new self();
$Comments = $TheForum->fetchAll("IDParent = '" . $this->IDForum . "'", "Date", $Limit, $Start);
$Ret = array();
if ($Comments) {
foreach ($Comments as $Comment) {
$TheForum = new Zwe_Forum_Message_Comment();
$TheForum->copyFromDb($Comment);
$Ret[] = $TheForum;
}
}
return $Ret;
}