当前位置: 首页>>代码示例>>PHP>>正文


PHP CollectionAttributeKey::getAttributes方法代码示例

本文整理汇总了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;
 }
开发者ID:ronlobo,项目名称:concrete5-de,代码行数:26,代码来源:collection_version.php

示例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);			
		}
开发者ID:remkoj,项目名称:concrete5,代码行数:31,代码来源:collection.php

示例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;
 }
开发者ID:homer6,项目名称:concrete5-mirror,代码行数:45,代码来源:collection_version.php

示例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);
			}
		}
开发者ID:ronlobo,项目名称:concrete5,代码行数:32,代码来源:collection.php

示例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);
		}
开发者ID:rii-J,项目名称:concrete5-de,代码行数:21,代码来源:collection.php


注:本文中的CollectionAttributeKey::getAttributes方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。