当前位置: 首页>>代码示例>>PHP>>正文


PHP ArrayObject::__construct方法代码示例

本文整理汇总了PHP中ArrayObject::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP ArrayObject::__construct方法的具体用法?PHP ArrayObject::__construct怎么用?PHP ArrayObject::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ArrayObject的用法示例。


在下文中一共展示了ArrayObject::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 public function __construct($data = array())
 {
     if ($data == null) {
         $data = array();
     }
     parent::__construct($data, \ArrayObject::STD_PROP_LIST | \ArrayObject::ARRAY_AS_PROPS);
 }
开发者ID:javaguirre,项目名称:php-extended-array,代码行数:7,代码来源:ExtendedArray.php

示例2: __construct

 /**
  * Create a translation object:
  * pre-fill with english and replace by $language specific data.
  *
  * @param array|null|object $language
  */
 public function __construct($language)
 {
     $default = Kimai_Config::getDefault(Kimai_Config::DEFAULT_LANGUAGE);
     $data = (include WEBROOT . 'language/' . $default . '.php');
     parent::__construct($data, \ArrayObject::ARRAY_AS_PROPS);
     $this->addTranslations($language);
 }
开发者ID:kimai,项目名称:kimai,代码行数:13,代码来源:Data.php

示例3: __construct

 public function __construct(IDataContainer $container)
 {
     parent::__construct();
     if ($container) {
         $this->offsetSet(0, $container);
     }
 }
开发者ID:burdiuz,项目名称:php-pap,代码行数:7,代码来源:DataLevels.php

示例4: __construct

 public function __construct($name, $_parent = null)
 {
     parent::__construct();
     $this->name = $name;
     $this->parentNode = $_parent;
     $this->isroot = $this->parentNode === null ? true : false;
 }
开发者ID:diamondo25,项目名称:mapler.me,代码行数:7,代码来源:TreeNode.php

示例5: __construct

 /**
  * Constructs this collection with a default set of formats if none are given.
  *
  * @param Format[]|null $input
  */
 public function __construct(array $input = null)
 {
     if ($input === null) {
         $input = array(Format::HTML => new Format(Format::HTML, 'text/html', array('html', 'htm')), Format::JSON => new Format(Format::JSON, 'application/json', 'json'), Format::LATEX => new Format(Format::LATEX, 'application/x-latex', 'tex'), Format::MARKDOWN => new Format(Format::MARKDOWN, 'text/x-markdown', 'md'), Format::PDF => new Format(Format::PDF, 'application/pdf', 'pdf'), Format::RST => new Format(Format::RST, 'text-x-rst', array('rst', 'txt', 'rest', 'restx')));
     }
     parent::__construct($input, 0, 'ArrayIterator');
 }
开发者ID:crazycodr,项目名称:phpDocumentor2,代码行数:12,代码来源:Collection.php

示例6:

 function __construct($results, $pagination = null)
 {
     parent::__construct($results);
     if ($pagination instanceof \WP_Clanwars\Pagination) {
         $this->_pagination = $pagination;
     }
 }
开发者ID:pronebird,项目名称:wp-clanwars,代码行数:7,代码来源:dbresult.class.php

示例7: get

 public function get($data = null)
 {
     parent::__construct(array(), ArrayObject::ARRAY_AS_PROPS);
     if (is_array($data)) {
         foreach ($data as $key => $value) {
             if (is_array($value)) {
                 $value = new self($value);
             }
             $this->offsetSet($key, $value);
         }
     } else {
         if ($data instanceof self) {
             $data = $this->toArray($data);
             $this->get($data);
         } else {
             if (is_string($data)) {
                 $db = MySQL::getInstance();
                 $db->query($data);
                 if ($db->numRows() > 0) {
                     $this->get($db->fetchRow());
                 }
             }
         }
     }
     return $this;
 }
开发者ID:kizz66,项目名称:meat,代码行数:26,代码来源:Object.php

示例8: __construct

 public function __construct(array $data)
 {
     $defaults = array_fill_keys(['name' => NULL, 'firstname' => NULL, 'name_thirdparty' => NULL, 'ref_ext' => NULL, 'client' => NULL, 'fournisseur' => NULL, 'address' => NULL, 'zip' => NULL, 'town' => NULL, 'country_id' => NULL, 'country_code' => NULL, 'phone' => NULL, 'phone_mobile' => NULL, 'fax' => NULL, 'email' => NULL, 'url' => NULL, 'profid1' => NULL, 'profid2' => NULL, 'profid3' => NULL, 'profid4' => NULL, 'profid5' => NULL, 'profid6' => NULL, 'capital' => NULL, 'tva_assuj' => NULL, 'tva_intra' => NULL, 'login' => NULL, 'password' => NULL, 'group_id' => NULL], NULL);
     // Merge defaults.
     $data += $defaults;
     parent::__construct($data, \ArrayObject::ARRAY_AS_PROPS);
 }
开发者ID:parisliakos,项目名称:dolibarr-php-client,代码行数:7,代码来源:ThirdPartyWithUser.php

示例9:

 function __construct(\Pyrus\PackageFile\v2\Files $parent, \Pyrus\PackageFile\v2 $ultraparent, array $info)
 {
     $this->parent = $parent;
     $this->pkg = $ultraparent;
     $this->tasksNs = $ultraparent->getTasksNs() . ':';
     parent::__construct($info);
 }
开发者ID:peopleplan,项目名称:Pyrus,代码行数:7,代码来源:File.php

示例10: __construct

 public function __construct(array $input = array(), $flags = 0, $iterator_class = "ArrayIterator")
 {
     if (is_array($input) && !empty($input)) {
         $this->checkInstanceOf(current($input));
     }
     parent::__construct($input, $flags, $iterator_class);
 }
开发者ID:jayveloper,项目名称:fcontrol,代码行数:7,代码来源:ProductCollection.php

示例11: __construct

 public function __construct(array $data)
 {
     $defaults = array_fill_keys(['id' => NULL, 'ref' => NULL, 'ref_ext' => NULL, 'fk_user_author' => NULL, 'status' => NULL, 'client' => NULL, 'supplier' => NULL, 'customer_code' => NULL, 'supplier_code' => NULL, 'customer_code_accountancy' => NULL, 'supplier_code_accountancy' => NULL, 'date_creation' => NULL, 'date_modification' => NULL, 'note_private' => NULL, 'note_public' => NULL, 'address' => NULL, 'zip' => NULL, 'town' => NULL, 'province_id' => NULL, 'country_id' => NULL, 'country_code' => NULL, 'country' => NULL, 'phone' => NULL, 'fax' => NULL, 'email' => NULL, 'url' => NULL, 'profid1' => NULL, 'profid2' => NULL, 'profid3' => NULL, 'profid4' => NULL, 'profid5' => NULL, 'profid6' => NULL, 'capital' => NULL, 'vat_used' => NULL, 'vat_number' => NULL], NULL);
     // Merge defaults.
     $data += $defaults;
     parent::__construct($data, \ArrayObject::ARRAY_AS_PROPS);
 }
开发者ID:parisliakos,项目名称:dolibarr-php-client,代码行数:7,代码来源:ThirdParty.php

示例12: __construct

 /**
  * @param array|\ArrayObject $data
  */
 public function __construct($data)
 {
     if (!$data instanceof self) {
         $data = $this->buildConfig($data);
     }
     parent::__construct($data);
 }
开发者ID:raphhh,项目名称:puppy-config,代码行数:10,代码来源:ArrayConfig.php

示例13: Processor

 function __construct(array $config, TreeBuilder $tree = null)
 {
     $processor = new Processor();
     $tree = $tree ?: ConfigTree::get();
     $config = ['bureaupieper_storee' => $config];
     parent::__construct($processor->process($tree->buildTree(), $config));
 }
开发者ID:BureauPieper,项目名称:storee-php-client,代码行数:7,代码来源:Config.php

示例14: __construct

 /**
  * Конструктор
  *
  * @param array $values
  * @internal param array|mixed $data
  * @return AbstractEntity
  */
 public function __construct($values = array())
 {
     if ($values instanceof EntityInterface) {
         /** @var $values AbstractEntity */
         parent::__construct($values, \ArrayObject::ARRAY_AS_PROPS);
         $this->autoAssignedData = $values->autoAssignedData;
         $this->isEmpty = $values->isEmpty;
         $this->dataTypes = $values->dataTypes;
         $this->_convertedFields = $values->_convertedFields;
         return;
     }
     $this->setupDataTypes();
     if (is_array($values) && !empty($values)) {
         foreach ($values as $name => $value) {
             if (!isset($this->dataTypes[$name])) {
                 //continue;
             }
             $this[$name] = $value;
             $this->isEmpty = false;
         }
     }
     if (is_array($this->dataTypes)) {
         foreach (array_keys($this->dataTypes) as $name) {
             if (!isset($this[$name])) {
                 $this->autoAssignedData[$name] = 1;
             }
         }
     }
 }
开发者ID:meniam,项目名称:model,代码行数:36,代码来源:AbstractEntity.php

示例15: __construct

 /**
  * __construct
  *
  * @param array $attributes array of attribute name => value pairs
  */
 public function __construct($attributes = array())
 {
     parent::__construct([]);
     if (!empty($attributes)) {
         $this->setAll($attributes);
     }
 }
开发者ID:txmodxoops,项目名称:rmcommon,代码行数:12,代码来源:Attributes.php


注:本文中的ArrayObject::__construct方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。