Example #1
0
		/**
		 * Gets the BlockType for a given Block Type ID
		 * @param int $btID
		 * @return BlockType
		 */
		public static function getByID($btID) {
			$bt = CacheLocal::getEntry('blocktype', $btID);
			if ($bt === -1) {
				return false;
			} else if (!is_object($bt)) {
				$where = 'btID = ?';
				$bt = BlockType::get($where, array($btID));			
				if (is_object($bt)) {
					CacheLocal::set('blocktype', $btID, $bt);
				} else {
					CacheLocal::set('blocktype', $btID, -1);
				}
			}
			$bt->controller = Loader::controller($bt);
			return $bt;
		}
Example #2
0
 /**
  * Gets the BlockType for a given Block Type ID
  * @param int $btID
  * @return BlockType
  */
 public static function getByID($btID)
 {
     $ca = new Cache();
     $bt = $ca->get('blockTypeByID', $btID);
     if (!is_object($bt)) {
         $where = 'btID = ?';
         $bt = BlockType::get($where, array($btID));
         $ca->set('blockTypeByID', $btID, $bt);
     }
     if (is_object($bt)) {
         $bt->controller = Loader::controller($bt);
         return $bt;
     }
     return $bt;
 }