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


PHP ArrayObject::count方法代码示例

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


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

示例1: getPayments

 /**
  * Get parsed payments
  *
  * @return \ArrayObject Payments array
  */
 public function getPayments()
 {
     if ($this->_payments->count() == 0) {
         $this->_logger->info("No payments found, did you invoke Parser::parse() before this call?");
     }
     return $this->_payments;
 }
开发者ID:Shmarkus,项目名称:PIM,代码行数:12,代码来源:AbstractParser.php

示例2: count

 public function count()
 {
     if (!isset($this->data)) {
         $this->lazyInitialization();
     }
     return $this->data->count();
 }
开发者ID:SystemEd-Jacob,项目名称:nethgui,代码行数:7,代码来源:TabularValueAdapter.php

示例3: validate

 /**
  * Valida o código de barras.
  * @param mixed $value
  * @return boolean
  */
 public function validate($input)
 {
     $input = new StringHelper($input);
     $digitoCean = 0;
     $indiceInicial = 0;
     $digitoCalculo = 0;
     $digitoCalculado = 0;
     $tamCean = $input->length;
     $ceanSemDigito = new StringHelper();
     if (!in_array($tamCean, array(8, 12, 13, 14, 18))) {
         return false;
     }
     $digitoCean = (int) $input->right(1, 1)->getValue();
     $ceanSemDigito->setValue($input->left(0, $input->length - 1)->getValue());
     $indiceInicial = $this->p->count() - $ceanSemDigito->length;
     for ($i = 0; $i < $ceanSemDigito->length; $i++) {
         $digitoCalculo += (int) $ceanSemDigito->substring($i, 1)->getValue() * $this->p->offsetGet($indiceInicial++);
     }
     if ($digitoCalculo % 10 == 0) {
         $digitoCalculado = 0;
     } else {
         $divTemp = (int) ceil($digitoCalculo / 10.0) * 10;
         $digitoCalculado = $divTemp - $digitoCalculo;
     }
     if ($digitoCalculado === $digitoCean) {
         return true;
     }
     return false;
 }
开发者ID:charlanalves,项目名称:sped,代码行数:34,代码来源:Cean.php

示例4: getAll

 /**
  * @return \ArrayObject|DistributorItem[]
  */
 public function getAll()
 {
     if (!$this->items->count()) {
         if ($this->rawItems->count()) {
             foreach ($this->rawItems as $item) {
                 $this->items->append(new DistributorItem($item));
             }
         }
     }
     return $this->items;
 }
开发者ID:arbi,项目名称:MyCode,代码行数:14,代码来源:Distributor.php

示例5: isClosed

 /**
  * @return bool
  */
 public function isClosed()
 {
     if ($this->points->count() < 3) {
         return false;
     }
     $firstPoint = $this->points->offsetGet(0);
     $lastPoint = $this->points->offsetGet($this->points->count() - 1);
     if ($firstPoint->getX() == $lastPoint->getX() && $firstPoint->getY() == $lastPoint->getY()) {
         return true;
     }
     return false;
 }
开发者ID:pepin82,项目名称:geometry,代码行数:15,代码来源:Points.php

示例6: createCVS

 /**
  * Crea un fichero csv con todas las facturas en sistema extraidas
  * en el corte de la consulta.
  */
 public function createCVS()
 {
     $message = null;
     try {
         \helper\FileSystemHelper::createCVS('allInvoicesFromDatabase', $this->listDTO);
         $dir = __DIR__;
         $message = "[34m Se ha creado el archivo [35m allInvoicesFromDatabase.csv [34m en {$dir}\n";
         echo "{$this->listDTO->count()}\n";
     } catch (\Exception $e) {
         error_log($e->getMessage(), 0);
         error_log($e->getTraceAsString(), 0);
         $message = "[31m {$e->getMessage()}";
     }
     return $message;
 }
开发者ID:uetiko,项目名称:SDInvoicesFileCheck,代码行数:19,代码来源:Invoice.php

示例7: run

 /**
  * Run TestCase.
  *
  * @param TestCase $testCase
  *
  * @return int Status code
  */
 public function run(TestCase $testCase)
 {
     $this->precondition($testCase);
     if ($this->tests->count() == 0) {
         $this->logger->notice('Tests not found in TestCase', ['pid' => getmypid()]);
         /** @var EventDispatcherInterface $dispatcher */
         $dispatcher = $this->container->get('dispatcher');
         $dispatcher->dispatch(EventStorage::EV_CASE_FILTERED);
         return 1;
     }
     $statusCode = 0;
     $testCaseEvent = new TestCaseEvent($this->reflectionClass->getName());
     $testCaseEvent->setAnnotations(self::getAnnotations($this->reflectionClass->getDocComment()));
     $this->controller->beforeCase($testCaseEvent);
     foreach ($this->tests as $test) {
         if ($test->getStatus() !== TestMeta::TEST_NEW && $test->getStatus() !== TestMeta::TEST_MARKED) {
             continue;
         }
         if ($this->testMethod($test)) {
             $statusCode = 1;
         }
     }
     $this->controller->afterCase($testCaseEvent);
     return $statusCode;
 }
开发者ID:komex,项目名称:unteist,代码行数:32,代码来源:Runner.php

示例8: elementAtOf

 /**
  * シーケンス内の指定されたインデックス位置にある要素を返します。
  *
  * @param \ArrayObject $source 返される要素が含まれるシーケンス
  * @param int $index 取得する要素の 0 から始まるインデックス
  *
  * @return mixed シーケンス内の指定された位置にある要素
  */
 public function elementAtOf(\ArrayObject $source, int $index)
 {
     if ($index < 0 || $index >= $source->count()) {
         throw new \OutOfRangeException();
     }
     return $source->offsetGet($index);
 }
开发者ID:yukar-php,项目名称:linq,代码行数:15,代码来源:TSearch.php

示例9: parseRawToList

 private function parseRawToList($raw)
 {
     $raw = trim($raw);
     if (!empty($raw)) {
         $list = new \ArrayObject();
         $token = explode(PHP_EOL, $raw);
         $a = 1;
         while ($a < count($token)) {
             next($token);
             $attr = new Attribute();
             if (!(current($token) == "!re") && !(current($token) == "!trap")) {
                 $split = explode("=", current($token));
                 $attr->setName($split[1]);
                 if (count($split) == 3) {
                     $attr->setValue($split[2]);
                 } else {
                     $attr->setValue(NULL);
                 }
                 $list->append($attr);
             }
             $a++;
         }
         if ($list->count() != 0) {
             $this->result->add($list);
         }
     }
 }
开发者ID:xwiz,项目名称:mikrotik-api,代码行数:27,代码来源:TalkerReciever.php

示例10: buildLastPage

 public function buildLastPage()
 {
     $page = null;
     if ($this->listPage->count() > 0) {
         $page = $this->listPage->offsetGet($this->listPage->count());
     }
     $this->lastPage = $page;
 }
开发者ID:virhi,项目名称:paginationbundle,代码行数:8,代码来源:Pagination.php

示例11: getResultsFound

 public function getResultsFound()
 {
     if ($this->results->count() > 0) {
         $result = $this->results->getIterator();
         $responseJson = '[';
         while ($result->valid()) {
             $object = $this->buildObject($result->current());
             $responseJson .= $object->toJSON() . ',';
             $result->next();
         }
         $responseJson = substr($responseJson, 0, -1);
         $responseJson .= ']';
         return $responseJson;
     } else {
         return null;
     }
 }
开发者ID:raigons,项目名称:bureauinteligencia,代码行数:17,代码来源:ProccessSearch.php

示例12: getCurrentSitemapNode

 public function getCurrentSitemapNode(Request $request)
 {
     $routeName = $request->get('_route');
     $routeParameters = $request->get('_route_params');
     //Agregar los parámetros http del requerimiento actual a la WebLocation.
     $routeParameters = array_merge($routeParameters, $request->query->all());
     $location = new RouteBasedLocation($routeName, $routeParameters);
     $it = new RouteSitemapNodeFilterIterator($this->getSitemap()->getIterator(), $location);
     $nodes = new \ArrayObject(iterator_to_array($it, false));
     if ($nodes->count() > 1) {
         throw new \Exception("Se encontró mas de un nodo en el sitemap que coincide con el requerimiento HTTP.");
     }
     if ($nodes->count() == 0) {
         throw new \Exception("No se encontró ningun nodo en el sitemap que coincida con el requerimiento actual.");
     } else {
         return $nodes[0];
     }
 }
开发者ID:bluegrass,项目名称:blues,代码行数:18,代码来源:AbstractSitemapManager.php

示例13: testOfType

 /**
  * @dataProvider providerOfType
  */
 public function testOfType($source, $type, $expectedParam)
 {
     $expected = new \ArrayObject($expectedParam);
     $mock = $this->getMockForTrait('Yukar\\Linq\\Enumerable\\TInspection');
     $result = $mock->ofTypeOf(new \ArrayObject($source), $type);
     $this->assertInstanceOf('\\ArrayObject', $result);
     $this->assertCount($expected->count(), $result);
     $this->assertEquals($expected, $result);
 }
开发者ID:yukar-php,项目名称:linq,代码行数:12,代码来源:TInspectionTest.php

示例14: drawHTML

 /**
  * @param \ArrayObject|\ArrayObject[] $logs
  * @param bool $amsterdamSuffix
  *
  * @return string
  */
 protected function drawHTML($logs, $amsterdamSuffix = false)
 {
     $displayLog = '';
     if ($logs && $logs->count()) {
         foreach ($logs as $log) {
             if ($log['action_id'] == Logger::ACTION_BLOB) {
                 $displayLog .= $this->blobBeautifier($log['value']);
             } else {
                 $displayLog .= $this->concatFieldsHTML($log, $amsterdamSuffix);
             }
         }
     }
     return $displayLog;
 }
开发者ID:arbi,项目名称:MyCode,代码行数:20,代码来源:LoggerEngine.php

示例15: getModulesDirectories

 /**
  * Retrieve modules directories
  * @return ArrayObject
  */
 public function getModulesDirectories()
 {
     if (self::$modulesDirectories->count() == 0) {
         foreach (scandir(self::$applicationDirectory) as $directory) {
             if ($directory == '..' || $directory == '.') {
                 continue;
             }
             if (is_dir(self::$applicationDirectory . DIRECTORY_SEPARATOR . $directory)) {
                 self::$modulesDirectories->append(realpath(self::$applicationDirectory . DIRECTORY_SEPARATOR . $directory));
             }
         }
     }
     return self::$modulesDirectories;
 }
开发者ID:hlegius,项目名称:PlainMVC,代码行数:18,代码来源:PlainConfig.php


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