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


PHP ArrayObject::getArrayCopy方法代码示例

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


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

示例1: uri

 /**
  * @return Uri
  */
 public function uri()
 {
     $query = "";
     $query .= $this->paramsLoginToQuery();
     $query .= $this->paramsOther();
     $query .= "&sch_del=" . implode(",", $this->id->getArrayCopy());
     return new Uri($this->proxy->getProtocol(), $this->proxy->getHost(), $this->proxy->getPort(), "/api/vms.do", $query);
 }
开发者ID:TMSolution,项目名称:SmsBundle,代码行数:11,代码来源:Delete.php

示例2: getData

 /**
  * retrieve the data-storage
  * @param bool $arrayCopy
  * @return array|\ArrayObject
  */
 protected function getData($arrayCopy = false)
 {
     if ($arrayCopy) {
         return $this->_data->getArrayCopy();
     } else {
         return $this->_data;
     }
 }
开发者ID:robotr,项目名称:mvcDemo,代码行数:13,代码来源:ModelAbstract.php

示例3: uri

 /**
  * @return Uri
  */
 public function uri()
 {
     $query = "";
     $query .= $this->paramsLoginToQuery();
     $query .= $this->paramsOther();
     if (count($this->groups) > 0) {
         $query .= "&groups=" . implode(",", $this->groups->getArrayCopy());
     }
     return new Uri($this->proxy->getProtocol(), $this->proxy->getHost(), $this->proxy->getPort(), "/api/phonebook.do", $query);
 }
开发者ID:TMSolution,项目名称:SmsBundle,代码行数:13,代码来源:ContactAdd.php

示例4: uri

 /**
  * @return Uri
  */
 public function uri()
 {
     $query = "";
     $query .= $this->paramsLoginToQuery();
     $query .= $this->paramsOther();
     if (!empty($this->groups)) {
         $query .= "&groups=" . implode(";", $this->groups->getArrayCopy());
     }
     $query .= "&list_contacts=1";
     return new Uri($this->proxy->getProtocol(), $this->proxy->getHost(), $this->proxy->getPort(), "/api/phonebook.do", $query);
 }
开发者ID:TMSolution,项目名称:SmsBundle,代码行数:14,代码来源:ContactList.php

示例5: sortBy

 /**
  * Sort by column name
  * @param mixed $column
  * @param bool $ascending
  * @return bool    Information about the sort of success
  */
 public function sortBy($column, $ascending = true)
 {
     $sortBy = array();
     foreach ($this->data as $key => $row) {
         if (!isset($row[$column])) {
             return false;
         }
         $sortBy[$key] = $row[$column];
     }
     $array = $this->data->getArrayCopy();
     array_multisort($sortBy, $ascending ? SORT_ASC : SORT_DESC, $array);
     $this->data = new \ArrayObject($array);
     return true;
 }
开发者ID:pipaslot,项目名称:rest,代码行数:20,代码来源:DataArray.php

示例6: get

 /**
  * Get an item from an array using "dot" notation.
  *
  * @param string|integer $index The index or identifier.
  * @param mixed          $default
  *
  * @return mixed|null
  */
 public static function get($index, $default = null)
 {
     if (self::$battery->offsetExists($index)) {
         return self::$battery->offsetGet($index);
     }
     $array = self::$battery->getArrayCopy();
     foreach ((array) explode('.', $index) as $segment) {
         if (!is_array($array) || !array_key_exists($segment, $array)) {
             return $default;
         }
         $array = $array[$segment];
     }
     return $array;
 }
开发者ID:gjerokrsteski,项目名称:pimf-framework,代码行数:22,代码来源:Config.php

示例7: compile

 public function compile($name)
 {
     $source = $this->getLoader()->getSource($name);
     $cacheKey = $this->getCacheFilename($name);
     $phpStr = '';
     try {
         $this->partials->exchangeArray([new FileResource($this->getLoader()->getCacheKey($name))]);
         $phpStr = LightnCandy::compile($source, $this->options);
     } catch (\Exception $e) {
         throw new LoaderException($e->getMessage());
     }
     $this->cache->write($cacheKey, '<?php // ' . $name . PHP_EOL . $phpStr, $this->partials->getArrayCopy());
     return $phpStr;
 }
开发者ID:jayS-de,项目名称:HandlebarsBundle,代码行数:14,代码来源:HandlebarsEnvironment.php

示例8: languageAndWorkspaceOverlay

 /**
  * Do translation and workspace overlay
  *
  * @param \ArrayObject $data
  * @return void
  */
 public function languageAndWorkspaceOverlay(\ArrayObject $data)
 {
     $overlayedMetaData = $this->getTsfe()->sys_page->getRecordOverlay('sys_file_metadata', $data->getArrayCopy(), $this->getTsfe()->sys_language_content, $this->getTsfe()->sys_language_contentOL);
     if ($overlayedMetaData !== NULL) {
         $data->exchangeArray($overlayedMetaData);
     }
 }
开发者ID:Mr-Robota,项目名称:TYPO3.CMS,代码行数:13,代码来源:FileMetadataOverlayAspect.php

示例9: listRegisteredFactory

 /**
  * To return all registered factories.
  * @api
  * @return string[]|array
  */
 public static function listRegisteredFactory()
 {
     if (!static::$factoryRegistry instanceof \ArrayAccess) {
         return array();
     }
     return array_keys(static::$factoryRegistry->getArrayCopy());
 }
开发者ID:rakesh-mohanta,项目名称:states,代码行数:12,代码来源:StandardStartupFactory.php

示例10: castArrayObject

 public static function castArrayObject(\ArrayObject $c, array $a, Stub $stub, $isNested)
 {
     $class = $stub->class;
     $flags = $c->getFlags();
     $b = array("~flag::STD_PROP_LIST" => (bool) ($flags & \ArrayObject::STD_PROP_LIST), "~flag::ARRAY_AS_PROPS" => (bool) ($flags & \ArrayObject::ARRAY_AS_PROPS), "~iteratorClass" => $c->getIteratorClass(), "~storage" => $c->getArrayCopy());
     if ($class === 'ArrayObject') {
         $a = $b;
     } else {
         if (!($flags & \ArrayObject::STD_PROP_LIST)) {
             $c->setFlags(\ArrayObject::STD_PROP_LIST);
             if ($a = (array) $c) {
                 $class = new \ReflectionClass($class);
                 foreach ($a as $k => $p) {
                     if (!isset($k[0]) || "" !== $k[0] && !$class->hasProperty($k)) {
                         unset($a[$k]);
                         $a["+" . $k] = $p;
                     }
                 }
             }
             $c->setFlags($flags);
         }
         $a += $b;
     }
     return $a;
 }
开发者ID:Chaireeee,项目名称:chaireeee,代码行数:25,代码来源:SplCaster.php

示例11: execute

 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $io = new SymfonyStyle($input, $output);
     $io->title('Exporting databases');
     $io->section('Exporting all databases');
     $strategies = $this->collectorDbStrategy->collectDatabasesStrategies();
     $totalStrategies = count($strategies);
     $io->writeln($totalStrategies . ' strategie(s) found.');
     $progressBar = new ProgressBar($output, $totalStrategies);
     $progressBar->setFormat(self::PROGRESS_BAR_FORMAT);
     $progressBar->setMessage('Beginning backuping');
     $this->eventDispatcher->dispatch(Events::BACKUP_BEGINS, new BackupBeginsEvent($output));
     $progressBar->start();
     $reportContent = new \ArrayObject();
     foreach ($strategies as $strategy) {
         $strategyIdentifier = $strategy->getIdentifier();
         $setProgressBarMessage = function ($message) use($progressBar, $strategyIdentifier) {
             $message = "[{$strategyIdentifier}] {$message}";
             $progressBar->setMessage($message);
             $progressBar->display();
         };
         $exportedFiles = $this->processorDatabaseDumper->dump($strategy, $setProgressBarMessage);
         $reportContent->append("Backuping of the database: {$strategyIdentifier}");
         foreach ($exportedFiles as $file) {
             $filename = $file->getPath();
             $reportContent->append("\t→ {$filename}");
         }
         $progressBar->advance();
     }
     $progressBar->finish();
     $io->newLine(2);
     $io->section('Report');
     $io->text($reportContent->getArrayCopy());
     $this->eventDispatcher->dispatch(Events::BACKUP_ENDS, new BackupEndsEvent($output));
 }
开发者ID:Viscaweb,项目名称:EasyBackups,代码行数:35,代码来源:DatabaseDumperCommand.php

示例12: execute

 /**
  * {@inheritdoc}
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     // Set filters & get data
     $type = $input->getArgument(self::TYPE_ARGUMENT);
     if ($type) {
         $this->productlist->setType($type);
     }
     $active = $input->getOption(self::ACTIVE_OPTION);
     if ($active) {
         $this->productlist->setStatus(1);
     }
     $products = $this->productlist->getProducts();
     // If only count, return it
     if ($input->getOption(self::COUNT_OPTION)) {
         return $output->writeln(sprintf('Count: %d', $products->getTotalCount()));
     }
     // Else prepare data for showing
     $types = $this->productlist->getProductTypesAssoc();
     $rows = new \ArrayObject();
     foreach ($products->getItems() as $id => $product) {
         $rows->append([$product->getId(), $product->getSku(), $product->getName(), $types[$product->getTypeId()]]);
     }
     // Output table layout
     $table = new Table($output);
     $table->setHeaders(['ID', 'SKU', 'Name', 'Type']);
     $table->setRows($rows->getArrayCopy());
     $table->render();
 }
开发者ID:stefandoorn,项目名称:magento2-console-productlist,代码行数:31,代码来源:ProductlistCommand.php

示例13: getListAsAnArrayObject

 private function getListAsAnArrayObject($list)
 {
     if ($list instanceof ArrayIterator) {
         $list = new ArrayObject($list->getArrayCopy());
     }
     return $list;
 }
开发者ID:raigons,项目名称:bureauinteligencia,代码行数:7,代码来源:Report.php

示例14: deleteConstant

 /**
  * Delete constant from constant list
  *
  * @param string $constant
  *
  * @return bool
  */
 public function deleteConstant($constant)
 {
     if (($index = array_search($constant, $this->constants->getArrayCopy())) !== false) {
         $this->constants->offsetUnset($index);
     }
     return $index !== false;
 }
开发者ID:zendframework,项目名称:zend-code,代码行数:14,代码来源:ValueGenerator.php

示例15: render

 public function render()
 {
     $retObj = new \ArrayObject($this->definition);
     $ret = $retObj->getArrayCopy();
     $ret['data'] = $this->formatData();
     return $ret;
 }
开发者ID:nedvisol,项目名称:phporm,代码行数:7,代码来源:BaseForm.php


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