本文整理匯總了PHP中DataObjectCollection::getViewName方法的典型用法代碼示例。如果您正苦於以下問題:PHP DataObjectCollection::getViewName方法的具體用法?PHP DataObjectCollection::getViewName怎麽用?PHP DataObjectCollection::getViewName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類DataObjectCollection
的用法示例。
在下文中一共展示了DataObjectCollection::getViewName方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: __construct
public function __construct(DataObjectCollection $collection, $use_session = TRUE, $use_system_company = TRUE, $search_id = '')
{
$tablename = $collection->getViewName();
$this->tablename = $tablename;
$this->use_session = $use_session;
$this->search_id = $search_id;
$this->constraints = new ConstraintChain();
$this->use_system_company = $use_system_company;
$this->setOrderby($collection->orderby, $collection->direction);
if (strpos($tablename, ' ')) {
$this->tablename = substr($tablename, strrpos($tablename, ' ') + 1);
}
$cache_id = array('searches', EGS_USERNAME, $this->tablename . '_' . $this->search_id);
$cache = Cache::Instance();
$cached_search = $cache->get($cache_id, 1800);
if ($this->use_session && $cached_search !== FALSE) {
foreach ($cached_search as $key => $val) {
if ($key == 'constraints' || $key == 'fields') {
$this->{$key} = unserialize($val);
} else {
$this->{$key} = $val;
}
}
debug('SearchHandler::__construct ' . $tablename . ' ' . print_r($this, TRUE));
// echo 'SearchHandler::__construct<pre>'.print_r($this, true).'</pre>';
} elseif ($this->use_system_company) {
//if usercompanyid is a field, then it's always a constraint
// TODO: Need to revisit this;
// gets added in DataObject(?)/DataObjectCollection(?)
// if the search is access controlled
$model = $collection->getModel();
if ($model->isField('usercompanyid')) {
$this->constraints = new ConstraintChain();
$this->addConstraint(new Constraint('usercompanyid', '=', EGS_COMPANY_ID));
}
}
$this->collection = $collection;
}