本文整理汇总了PHP中Pimcore::inAdmin方法的典型用法代码示例。如果您正苦于以下问题:PHP Pimcore::inAdmin方法的具体用法?PHP Pimcore::inAdmin怎么用?PHP Pimcore::inAdmin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pimcore
的用法示例。
在下文中一共展示了Pimcore::inAdmin方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __wakeup
/**
*
*/
public function __wakeup()
{
$options = $this->getOptions();
if (\Pimcore::inAdmin() || empty($options)) {
$this->configureOptions();
}
}
示例2: callResourceMethod
/**
* @param string $method
* @param array $args
* @return mixed
*/
public function callResourceMethod($method, $args)
{
$capture = false;
if (Pimcore::inAdmin()) {
$methodsToCheck = array("query", "update", "delete", "insert");
if (in_array($method, $methodsToCheck)) {
$capture = true;
Pimcore_Resource::startCapturingDefinitionModifications($method, $args);
}
}
//HACK - do not execute transaction methods when
//Zend_Registry::set('explicit_transactions', true) was set earlier in code
$transactionMethodsToCheck = array('beginTransaction', 'rollBack', 'commit');
try {
$explicitTransactions = Zend_Registry::get('explicit_transactions');
} catch (Exception $e) {
$explicitTransactions = false;
}
if (!$explicitTransactions || !in_array($method, $transactionMethodsToCheck)) {
$r = call_user_func_array(array($this->getResource(), $method), $args);
}
if (Pimcore::inAdmin() && $capture) {
Pimcore_Resource::stopCapturingDefinitionModifications();
}
return $r;
}
示例3: getTokenSettings
/**
* @return \Pimcore\Model\Object\Fieldcollection
*/
public function getTokenSettings()
{
$preValue = $this->preGetValue("tokenSettings");
if ($preValue !== null && !\Pimcore::inAdmin()) {
return $preValue;
}
$data = $this->getClass()->getFieldDefinition("tokenSettings")->preGetData($this);
return $data;
}
示例4: __set_state
/**
* @param $data
* @return static
*/
public static function __set_state($data)
{
$obj = parent::__set_state($data);
$options = $obj->getOptions();
if (\Pimcore::inAdmin() || empty($options)) {
$obj->configureOptions();
}
return $obj;
}
示例5: getPriceRule
/**
* Get priceRule - Price Rule
* @return CoreShop\Model\PriceRule
*/
public function getPriceRule()
{
$preValue = $this->preGetValue("priceRule");
if ($preValue !== null && !\Pimcore::inAdmin()) {
return $preValue;
}
$data = $this->priceRule;
return $data;
}
示例6: getName
/**
* Get name - Name
* @return string
*/
public function getName($language = null)
{
$data = $this->getLocalizedfields()->getLocalizedValue("name", $language);
$preValue = $this->preGetValue("name");
if ($preValue !== null && !\Pimcore::inAdmin()) {
return $preValue;
}
return $data;
}
示例7: getName
/**
* Get name - Name
* @return string
*/
public function getName()
{
$preValue = $this->preGetValue("name");
if ($preValue !== null && !\Pimcore::inAdmin()) {
return $preValue;
}
$data = $this->name;
return $data;
}
示例8: getFooterobjectdata
/**
* @return \Pimcore\Model\Object\Fieldcollection
*/
public function getFooterobjectdata()
{
$preValue = $this->preGetValue("footerobjectdata");
if ($preValue !== null && !\Pimcore::inAdmin()) {
return $preValue;
}
$data = $this->getClass()->getFieldDefinition("footerobjectdata")->preGetData($this);
return $data;
}
示例9: init
/**
* @return User
*/
protected function init()
{
//loads select list options
$options = $this->getOptions();
if (\Pimcore::inAdmin() || empty($options)) {
$this->configureOptions();
}
return $this;
}
示例10: getChilds
public function getChilds()
{
if ($this->childs === null) {
$childs = parent::getChilds();
$hardLink = $this->getHardLinkSource();
if ($hardLink->getChildsFromSource() && $hardLink->getSourceDocument() && !Pimcore::inAdmin()) {
foreach ($childs as &$c) {
$c = Document_Hardlink_Service::wrap($c);
$c->setHardLinkSource($hardLink);
$c->setPath(preg_replace("@^" . preg_quote($hardLink->getSourceDocument()->getFullpath()) . "@", $hardLink->getFullpath(), $c->getPath()));
}
}
$this->setChilds($childs);
}
return $this->childs;
}
示例11: getOfferedServices
/**
* @return \Pimcore\Model\Object\Objectbrick
*/
public function getOfferedServices()
{
$data = $this->offeredServices;
if (!$data) {
if (\Pimcore\Tool::classExists("\\Pimcore\\Model\\Object\\Subscriptions\\OfferedServices")) {
$data = new \Pimcore\Model\Object\Subscriptions\OfferedServices($this, "offeredServices");
$this->offeredServices = $data;
} else {
return null;
}
}
$preValue = $this->preGetValue("offeredServices");
if ($preValue !== null && !\Pimcore::inAdmin()) {
return $preValue;
}
return $data;
}
示例12: __wakeup
public function __wakeup()
{
if (Pimcore::inAdmin()) {
$this->configureOptions();
}
}
示例13: getPath
/**
* @return string
*/
public function getPath()
{
// check for site, if so rewrite the path for output
try {
if (!\Pimcore::inAdmin() && Site::isSiteRequest()) {
$site = Site::getCurrentSite();
if ($site instanceof Site) {
if ($site->getRootDocument() instanceof Document\Page && $site->getRootDocument() !== $this) {
$rootPath = $site->getRootPath();
$rootPath = preg_quote($rootPath);
return preg_replace("@^" . $rootPath . "@", "", $this->path);
}
}
}
} catch (\Exception $e) {
\Logger::error($e);
}
return $this->path;
}
示例14: getIcon
/**
* Get icon - icon
* @return string
*/
public function getIcon()
{
$preValue = $this->preGetValue("icon");
if ($preValue !== null && !\Pimcore::inAdmin()) {
return $preValue;
}
$data = $this->icon;
return $data;
}
示例15: getImage_3
/**
* Get image_3 - Image
* @return \Pimcore\Model\Asset\Image
*/
public function getImage_3()
{
$preValue = $this->preGetValue("image_3");
if ($preValue !== null && !\Pimcore::inAdmin()) {
return $preValue;
}
$data = $this->image_3;
return $data;
}