本文整理汇总了PHP中Zend_Db_Table::_fetch方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Db_Table::_fetch方法的具体用法?PHP Zend_Db_Table::_fetch怎么用?PHP Zend_Db_Table::_fetch使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Db_Table
的用法示例。
在下文中一共展示了Zend_Db_Table::_fetch方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _fetch
/**
* Переписываем стандартный _fetch с учётом выборки связанных данных
*
* @param Zend_Db_Table_Select $select
*/
protected function _fetch(Zend_Db_Table_Select $select)
{
if ($this->_route_id) {
$select = $select->where('route_id = ?', $this->_route_id);
}
$rows = parent::_fetch($select);
foreach ($rows as &$row) {
foreach ($row as $fieldName => $field) {
if (array_key_exists($this->_cleanName . '_' . $fieldName, self::$linkedFieldsTableData)) {
if ($this->_isSerialized($row[$fieldName])) {
$row[$fieldName] = $this->_unserialize($row[$fieldName]);
if (sizeof($row[$fieldName])) {
$field = implode(',', $row[$fieldName]);
}
}
$data = explode(',', $field);
foreach ($data as $val) {
$val = chop($val);
foreach (self::$linkedFieldsTableData[$this->_cleanName . '_' . $fieldName] as $linked_row) {
if (is_array($linked_row) && $val == $linked_row['publication_id']) {
if (false == array_key_exists($fieldName . '_linked', $row) || false == is_array($row[$fieldName . '_linked'])) {
$row[$fieldName . '_linked'] = array();
}
array_push($row[$fieldName . '_linked'], $linked_row);
break;
}
}
}
}
}
$row['rubric_id'] = $row['pub_rubric_id'] = $this->_tableProfile[0]->rubric_id;
}
return $rows;
}
示例2: _fetch
/**
*
* @param Zend_Db_Table_Select $select
* @return type
*/
protected function _fetch(Zend_Db_Table_Select $select)
{
if (in_array('deleted', $this->_getCols())) {
$select->where($this->_name . '.deleted = 0');
}
/*
if ($this->getAutoRestrict()) {
if (in_array($this->getAutoRestrict(), $this->_getCols())) {
$identity = Zend_Auth::getInstance()->getIdentity();
if (isset($identity->empresa_id) && $identity->empresa_id) {
$select->where($this->_name . '.' . $this->getAutoRestrict() .' = ?', $identity->empresa_id);
}
}
}
*/
if ($this->getAutoJoin()) {
$select = $this->addAutoJoin($select);
}
return parent::_fetch($select);
}