当前位置: 首页>>代码示例>>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;未经允许,请勿转载。