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