當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。