本文整理汇总了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);
}
示例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);
}
示例3: __construct
public function __construct(IDataContainer $container)
{
parent::__construct();
if ($container) {
$this->offsetSet(0, $container);
}
}
示例4: __construct
public function __construct($name, $_parent = null)
{
parent::__construct();
$this->name = $name;
$this->parentNode = $_parent;
$this->isroot = $this->parentNode === null ? true : false;
}
示例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');
}
示例6:
function __construct($results, $pagination = null)
{
parent::__construct($results);
if ($pagination instanceof \WP_Clanwars\Pagination) {
$this->_pagination = $pagination;
}
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例12: __construct
/**
* @param array|\ArrayObject $data
*/
public function __construct($data)
{
if (!$data instanceof self) {
$data = $this->buildConfig($data);
}
parent::__construct($data);
}
示例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));
}
示例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;
}
}
}
}
示例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);
}
}