本文整理汇总了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;
}