本文整理汇总了PHP中CollectionAttributeKey::getAttributes方法的典型用法代码示例。如果您正苦于以下问题:PHP CollectionAttributeKey::getAttributes方法的具体用法?PHP CollectionAttributeKey::getAttributes怎么用?PHP CollectionAttributeKey::getAttributes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CollectionAttributeKey
的用法示例。
在下文中一共展示了CollectionAttributeKey::getAttributes方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get
public function get(&$c, $cvID)
{
if (is_string($cvID)) {
$cvID = CollectionVersion::getNumericalVersionID($c->getCollectionID(), $cvID);
}
$cv = new CollectionVersion();
$db = Loader::db();
$q = "select cvID, cvIsApproved, cvIsNew, cvHandle, cvName, cvDescription, cvDateCreated, cvDatePublic, cvAuthorUID, cvApproverUID, cvComments, ptID, CollectionVersions.ctID, ctHandle, ctName from CollectionVersions left join PageTypes on CollectionVersions.ctID = PageTypes.ctID where cID = ? and cvID = ?";
$r = $db->query($q, array($c->getCollectionID(), $cvID));
if ($r) {
$row = $r->fetchRow();
if ($row) {
$cv->setPropertiesFromArray($row);
}
}
// load the attributes for a particular version object
Loader::model('attribute/categories/collection');
$cv->attributes = CollectionAttributeKey::getAttributes($c->getCollectionID(), $cvID);
$cv->cID = $c->getCollectionID();
$cv->cvIsMostRecent = $cv->_checkRecent();
$r = $db->GetAll('select csrID, arHandle from CollectionVersionAreaStyles where cID = ? and cvID = ?', array($c->getCollectionID(), $cvID));
foreach ($r as $styles) {
$cv->customAreaStyles[$styles['arHandle']] = $styles['csrID'];
}
return $cv;
}
示例2: reindex
public function reindex($index = false) {
if ($this->isAlias()) {
return false;
}
$db = Loader::db();
Loader::model('attribute/categories/collection');
$attribs = CollectionAttributeKey::getAttributes($this->getCollectionID(), $this->getVersionID(), 'getSearchIndexValue');
$db->Execute('delete from CollectionSearchIndexAttributes where cID = ?', array($this->getCollectionID()));
$searchableAttributes = array('cID' => $this->getCollectionID());
$rs = $db->Execute('select * from CollectionSearchIndexAttributes where cID = -1');
AttributeKey::reindex('CollectionSearchIndexAttributes', $searchableAttributes, $attribs, $rs);
if ($index == false) {
Loader::library('database_indexed_search');
$index = new IndexedSearch();
}
$datetime = Loader::helper('date')->getSystemDateTime();
$db->Replace('PageSearchIndex', array(
'cID' => $this->getCollectionID(),
'cName' => $this->getCollectionName(),
'cDescription' => $this->getCollectionDescription(),
'cPath' => $this->getCollectionPath(),
'cDatePublic' => $this->getCollectionDatePublic(),
'content' => $index->getBodyContentFromPage($this),
'cDateLastIndexed' => $datetime
), array('cID'), true);
}
示例3: get
public function get(&$c, $cvID)
{
if (is_string($cvID)) {
$cvID = CollectionVersion::getNumericalVersionID($c->getCollectionID(), $cvID);
}
$ca = new Cache();
$cv = $ca->get('collection_version', $c->getCollectionID() . ':' . $cvID);
if ($cv instanceof CollectionVersion) {
return $cv;
}
$cv = new CollectionVersion();
$db = Loader::db();
$q = "select cvID, cvIsApproved, cvIsNew, cvHandle, cvName, cvDescription, cvDateCreated, cvDatePublic, cvAuthorUID, cvApproverUID, cvComments from CollectionVersions where cID = ? and cvID = ?";
$r = $db->query($q, array($c->getCollectionID(), $cvID));
if ($r) {
$row = $r->fetchRow();
if ($row) {
$cv->setPropertiesFromArray($row);
}
}
if ($cv->cvAuthorUID > 0) {
$uAuthor = UserInfo::getByID($cv->cvAuthorUID);
if (is_object($uAuthor)) {
$cv->cvAuthorUname = $uAuthor->getUserName();
}
}
if ($cv->cvApproverUID > 0) {
$uApprover = UserInfo::getByID($cv->cvApproverUID);
if (is_object($uApprover)) {
$cv->cvApproverUname = $uApprover->getUserName();
}
}
// load the attributes for a particular version object
Loader::model('attribute/categories/collection');
$cv->attributes = CollectionAttributeKey::getAttributes($c->getCollectionID(), $cvID);
$cv->cID = $c->getCollectionID();
$cv->cvIsMostRecent = $cv->_checkRecent();
$r = $db->GetAll('select csrID, arHandle from CollectionVersionAreaStyles where cID = ? and cvID = ?', array($c->getCollectionID(), $cvID));
foreach ($r as $styles) {
$cv->customAreaStyles[$styles['arHandle']] = $styles['csrID'];
}
$ca = new Cache();
$ca->set('collection_version', $c->getCollectionID() . ':' . $cvID, $cv);
return $cv;
}
示例4: reindex
public function reindex($index = false, $actuallyDoReindex = true) {
if ($this->isAlias()) {
return false;
}
if ($actuallyDoReindex || ENABLE_PROGRESSIVE_PAGE_REINDEX == false) {
$db = Loader::db();
Loader::model('attribute/categories/collection');
$attribs = CollectionAttributeKey::getAttributes($this->getCollectionID(), $this->getVersionID(), 'getSearchIndexValue');
$db->Execute('delete from CollectionSearchIndexAttributes where cID = ?', array($this->getCollectionID()));
$searchableAttributes = array('cID' => $this->getCollectionID());
$rs = $db->Execute('select * from CollectionSearchIndexAttributes where cID = -1');
AttributeKey::reindex('CollectionSearchIndexAttributes', $searchableAttributes, $attribs, $rs);
if ($index == false) {
Loader::library('database_indexed_search');
$index = new IndexedSearch();
}
$index->reindexPage($this);
$db->Replace('PageSearchIndex', array('cID' => $this->getCollectionID(), 'cRequiresReindex' => 0), array('cID'), false);
$cache = PageCache::getLibrary();
$cache->purge($this);
} else {
$db = Loader::db();
Config::save('DO_PAGE_REINDEX_CHECK', true);
$db->Replace('PageSearchIndex', array('cID' => $this->getCollectionID(), 'cRequiresReindex' => 1), array('cID'), false);
}
}
示例5: reindex
public function reindex($index = false) {
if ($this->isAlias()) {
return false;
}
$db = Loader::db();
Loader::model('attribute/categories/collection');
$attribs = CollectionAttributeKey::getAttributes($this->getCollectionID(), $this->getVersionID(), 'getSearchIndexValue');
$db->Execute('delete from CollectionSearchIndexAttributes where cID = ?', array($this->getCollectionID()));
$searchableAttributes = array('cID' => $this->getCollectionID());
$rs = $db->Execute('select * from CollectionSearchIndexAttributes where cID = -1');
AttributeKey::reindex('CollectionSearchIndexAttributes', $searchableAttributes, $attribs, $rs);
if ($index == false) {
Loader::library('database_indexed_search');
$index = new IndexedSearch();
}
$index->reindexPage($this);
}