本文整理汇总了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;
}
示例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;
}
}
示例3: getById
/**
* @param integer $id
* @return Redirect
*/
public static function getById($id)
{
$redirect = new self();
$redirect->setId(intval($id));
$redirect->getDao()->getById();
return $redirect;
}
示例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;
}
示例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;
}
}
示例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;
}
}
示例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;
}
示例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;
}
}
示例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;
}
示例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;
}
}
示例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) {
}
}
示例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;
}
示例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;
}
}
示例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;
}
示例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;
}