當前位置: 首頁>>代碼示例>>PHP>>正文


PHP self::getDao方法代碼示例

本文整理匯總了PHP中self::getDao方法的典型用法代碼示例。如果您正苦於以下問題:PHP self::getDao方法的具體用法?PHP self::getDao怎麽用?PHP self::getDao使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在self的用法示例。


在下文中一共展示了self::getDao方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getById

 /**
  * @param integer $id
  * @return Glossary
  */
 public static function getById($id)
 {
     $glossary = new self();
     $glossary->setId(intval($id));
     $glossary->getDao()->getById();
     return $glossary;
 }
開發者ID:solverat,項目名稱:pimcore,代碼行數:11,代碼來源:Glossary.php

示例2: get

 /**
  * @param string $key
  * @param boolean $returnObject
  * @return mixed|null
  */
 public static function get($key, $returnObject = FALSE)
 {
     $cacheKey = $key . '~~~';
     if (array_key_exists($cacheKey, self::$nameIdMappingCache)) {
         $entry = self::getById(self::$nameIdMappingCache[$cacheKey]);
         if ($returnObject) {
             return $entry;
         }
         return $entry instanceof Configuration ? $entry->getData() : NULL;
     }
     $configurationEntry = new self();
     try {
         $configurationEntry->getDao()->getByKey($key);
     } catch (\Exception $e) {
         return NULL;
     }
     if ($configurationEntry->getId() > 0) {
         self::$nameIdMappingCache[$cacheKey] = $configurationEntry->getId();
         $entry = self::getById($configurationEntry->getId());
         if ($returnObject) {
             return $entry;
         }
         return $entry instanceof Configuration ? $entry->getData() : NULL;
     }
 }
開發者ID:dachcom-digital,項目名稱:pimcore-lucene-search,代碼行數:30,代碼來源:Configuration.php

示例3: getById

 /**
  * @param integer $id
  * @return Redirect
  */
 public static function getById($id)
 {
     $redirect = new self();
     $redirect->setId(intval($id));
     $redirect->getDao()->getById();
     return $redirect;
 }
開發者ID:solverat,項目名稱:pimcore,代碼行數:11,代碼來源:Redirect.php

示例4: getBySourceId

 /**
  * Static helper to get the dependencies for the given sourceId & type
  *
  * @param integer $id
  * @param string $type
  * @return Dependency
  */
 public static function getBySourceId($id, $type)
 {
     $d = new self();
     $d->setSourceId($id);
     $d->setSourceType($type);
     $d->getDao()->getBySourceId();
     return $d;
 }
開發者ID:pimcore,項目名稱:pimcore,代碼行數:15,代碼來源:Dependency.php

示例5: getById

 /**
  * @static
  * @param $id
  * @return Element\Note
  */
 public static function getById($id)
 {
     try {
         $note = new self();
         $note->getDao()->getById($id);
         return $note;
     } catch (\Exception $e) {
         return null;
     }
 }
開發者ID:emanuel-london,項目名稱:pimcore,代碼行數:15,代碼來源:Note.php

示例6: getByAddress

 /**
  * @param $addr
  * @return null|Blacklist
  */
 public static function getByAddress($addr)
 {
     try {
         $address = new self();
         $address->getDao()->getByAddress($addr);
         return $address;
     } catch (\Exception $e) {
         return null;
     }
 }
開發者ID:ChristophWurst,項目名稱:pimcore,代碼行數:14,代碼來源:Blacklist.php

示例7: getByName

 /**
  * @param $name
  * @return Config
  * @throws \Exception
  */
 public static function getByName($name)
 {
     try {
         $tag = new self();
         $tag->getDao()->getByName($name);
     } catch (\Exception $e) {
         return null;
     }
     return $tag;
 }
開發者ID:emanuel-london,項目名稱:pimcore,代碼行數:15,代碼來源:Config.php

示例8: getByPrimary

 /**
  * @param $cid
  * @param $ctype
  * @param $workflowId
  * @return null|WorkflowState
  */
 public static function getByPrimary($cid, $ctype, $workflowId)
 {
     try {
         $workflowState = new self();
         $workflowState->getDao()->getByPrimary($cid, $ctype, $workflowId);
         return $workflowState;
     } catch (\Exception $e) {
         return null;
     }
 }
開發者ID:pimcore,項目名稱:pimcore,代碼行數:16,代碼來源:WorkflowState.php

示例9: getByName

 /**
  * @param $name
  * @return null|Config
  */
 public static function getByName($name)
 {
     try {
         $letter = new self();
         $letter->getDao()->getByName($name);
     } catch (\Exception $e) {
         return null;
     }
     return $letter;
 }
開發者ID:jansarmir,項目名稱:pimcore,代碼行數:14,代碼來源:Config.php

示例10: getById

 /**
  * @static
  * @param $id
  * @return Pimcore\Model\Element\Tag
  */
 public static function getById($id)
 {
     try {
         $tag = new self();
         $tag->getDao()->getById($id);
         return $tag;
     } catch (\Exception $e) {
         return null;
     }
 }
開發者ID:pokleh,項目名稱:pimcore,代碼行數:15,代碼來源:Tag.php

示例11: getByName

 /**
  * @param $name
  * @return GroupConfig
  */
 public static function getByName($name)
 {
     try {
         $config = new self();
         $config->setName($name);
         $config->getDao()->getByName();
         return $config;
     } catch (\Exception $e) {
     }
 }
開發者ID:sfie,項目名稱:pimcore,代碼行數:14,代碼來源:GroupConfig.php

示例12: getById

 /**
  * Static helper to retrieve an instance of Document\DocType by the given ID
  *
  * @param integer $id
  * @return DocType
  */
 public static function getById($id)
 {
     $docType = new self();
     $docType->setId(intval($id));
     try {
         $docType->getDao()->getById();
     } catch (\Exception $e) {
         return null;
     }
     return $docType;
 }
開發者ID:sfie,項目名稱:pimcore,代碼行數:17,代碼來源:DocType.php

示例13: getById

 /**
  * @param $id
  * @return null|Persona
  */
 public static function getById($id)
 {
     try {
         $persona = new self();
         $persona->setId(intval($id));
         $persona->getDao()->getById();
         return $persona;
     } catch (\Exception $e) {
         return null;
     }
 }
開發者ID:sfie,項目名稱:pimcore,代碼行數:15,代碼來源:Persona.php

示例14: getByName

 /**
  * @param string $name
  * @return WebsiteSetting
  */
 public static function getByName($name, $siteId = null)
 {
     // create a tmp object to obtain the id
     $setting = new self();
     try {
         $setting->getDao()->getByName($name, $siteId);
     } catch (\Exception $e) {
         \Logger::error($e);
         return null;
     }
     return $setting;
 }
開發者ID:solverat,項目名稱:pimcore,代碼行數:16,代碼來源:WebsiteSetting.php

示例15: getByDate

 /**
  * @param $category
  * @param $action
  * @param $label
  * @param $day
  * @param $month
  * @param $year
  * @return Event
  */
 public static function getByDate($category, $action, $label, $day, $month, $year)
 {
     $event = new self();
     try {
         $event->getDao()->getByDate($category, $action, $label, $day, $month, $year);
     } catch (\Exception $e) {
         $event->setTimestamp(mktime(1, 0, 0, $month, $day, $year));
         $event->setCategory($category);
         $event->setAction($action);
         $event->setLabel($label);
     }
     return $event;
 }
開發者ID:sfie,項目名稱:pimcore,代碼行數:22,代碼來源:Event.php


注:本文中的self::getDao方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。