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


PHP Entity::__construct方法代碼示例

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


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

示例1: __construct

 /**
  * Entity constructor.
  *
  * @param array $properties
  * @param array $options
  */
 public function __construct(array $properties = [], array $options = [])
 {
     if (isset($properties['params']) && is_string($properties['params'])) {
         $properties['params'] = json_decode($properties['params'], true);
     }
     parent::__construct($properties, $options);
 }
開發者ID:UnionCMS,項目名稱:Core,代碼行數:13,代碼來源:Entity.php

示例2: __construct

 /**
  * Constructor
  *
  * @param array $properties hash of properties to set in this entity
  * @param array $options list of options to use when creating this entity
  */
 public function __construct(array $properties = [], array $options = [])
 {
     $options += ['pathBuilder' => $this->_pathBuilderClass, 'pathBuilderOptions' => $this->_pathBuilderOptions];
     parent::__construct($properties, $options);
     if (!empty($options['pathBuilder'])) {
         $this->pathBuilder($options['pathBuilder'], $options['pathBuilderOptions']);
     }
 }
開發者ID:tiagocapelli,項目名稱:cakephp-file-storage,代碼行數:14,代碼來源:FileStorage.php

示例3: __construct

 /**
  *  Preliminary check for alternate/tmp file must be made 
  */
 public function __construct(array $properties, array $options)
 {
     parent::__construct($properties, $options);
     Configure::load('UploadManager.images', 'default');
     $this->tmpDirPath = Configure::read('Images.tmpStoragePath');
     $this->tmpDirFull = WWW_ROOT . $this->tmpDirPath;
     $tmpPath = $this->tmpDirPath . DS . $this->source() . '-' . $this->_properties['id'];
     $tmpPathFull = WWW_ROOT . $tmpPath;
     $tmp = new File($tmpPathFull);
     if ($tmp->exists()) {
         $this->tmpPath = $tmpPath;
         $this->tmpPathFull = $tmpPathFull;
     }
 }
開發者ID:propellerstudios,項目名稱:UploadManager,代碼行數:17,代碼來源:Image.php

示例4: __construct

 public function __construct($properties = [], $options = [])
 {
     parent::__construct($properties, $options);
     if ($this->isNew()) {
         $this->set($this->_defaults, ['guard' => false]);
     }
     foreach ($this->_editAuth as $p => $access) {
         if (is_bool($access)) {
             $this->accessible($p, $access);
             continue;
         }
         if (!is_array($access)) {
             $access = [$access];
         }
         $this->accessible($p, false);
         foreach ($access as $auth) {
             if (AuthState::hasRole($auth)) {
                 $this->accessible($p, true);
                 break;
             }
         }
     }
     foreach ($this->_showAuth as $p => $access) {
         if (!is_array($access)) {
             $access = [$access];
         }
         $show = false;
         foreach ($access as $auth) {
             if (AuthState::hasRole($auth)) {
                 $show = true;
                 break;
             }
         }
         if (!$show) {
             $this->_hidden[] = $p;
         }
     }
 }
開發者ID:pwerken,項目名稱:va-void,代碼行數:38,代碼來源:AppEntity.php

示例5: __construct

 /**
  * Token constructor.
  *
  * @param array $properties
  * @param array $options
  */
 public function __construct(array $properties = [], array $options = [])
 {
     $lifetime = Configure::read('Muffin/Tokenize.lifetime') ?: self::DEFAULT_LIFETIME;
     $properties += ['token' => self::random(), 'status' => false, 'expired' => date('Y-m-d H:i:s', strtotime($lifetime))];
     parent::__construct($properties, $options);
 }
開發者ID:UseMuffin,項目名稱:Tokenize,代碼行數:12,代碼來源:Token.php


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