當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Arrays::any方法代碼示例

本文整理匯總了PHP中Ouzo\Utilities\Arrays::any方法的典型用法代碼示例。如果您正苦於以下問題:PHP Arrays::any方法的具體用法?PHP Arrays::any怎麽用?PHP Arrays::any使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Ouzo\Utilities\Arrays的用法示例。


在下文中一共展示了Arrays::any方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: join

 public function join()
 {
     $any = Arrays::any($this->_query->joinClauses, function (JoinClause $joinClause) {
         return Strings::equalsIgnoreCase($joinClause->type, 'RIGHT');
     });
     if ($any) {
         throw new BadMethodCallException('RIGHT JOIN is not supported in sqlite3');
     }
     return parent::join();
 }
開發者ID:letsdrink,項目名稱:ouzo,代碼行數:10,代碼來源:Sqlite3Dialect.php

示例2: _buildWhereKeyIn

 private static function _buildWhereKeyIn($column, array $array)
 {
     $useRestrictions = Arrays::any($array, Functions::isInstanceOf('\\Ouzo\\Restriction\\Restriction'));
     if ($useRestrictions) {
         return DialectUtil::joinClauses($array, 'OR', function (Restriction $restriction) use($column) {
             return $restriction->toSql($column);
         });
     }
     $in = implode(', ', array_fill(0, count($array), '?'));
     return $column . ' IN (' . $in . ')';
 }
開發者ID:letsdrink,項目名稱:ouzo,代碼行數:11,代碼來源:ArrayWhereClause.php

示例3: excludes

 public function excludes()
 {
     $elements = func_get_args();
     $currentArray = $this->actual;
     $foundElement = '';
     $anyFound = Arrays::any($elements, function ($element) use($currentArray, &$foundElement) {
         $checkInArray = Arrays::contains($currentArray, $element);
         if ($checkInArray) {
             $foundElement = $element;
         }
         return $checkInArray;
     });
     AssertAdapter::assertFalse($anyFound, "Found element {$foundElement} in array {$this->actualString}");
     return $this;
 }
開發者ID:letsdrink,項目名稱:ouzo,代碼行數:15,代碼來源:ArrayAssert.php

示例4: isAlreadyAddedToFetch

 private function isAlreadyAddedToFetch(RelationToFetch $relationToFetch)
 {
     return Arrays::any($this->_relationsToFetch, RelationToFetch::equalsPredicate($relationToFetch));
 }
開發者ID:letsdrink,項目名稱:ouzo,代碼行數:4,代碼來源:ModelQueryBuilder.php

示例5: whereClauseNeverSatisfied

 private static function whereClauseNeverSatisfied($whereClauses)
 {
     return Arrays::any($whereClauses, function (WhereClause $whereClause) {
         return $whereClause->isNeverSatisfied();
     });
 }
開發者ID:letsdrink,項目名稱:ouzo,代碼行數:6,代碼來源:QueryExecutor.php

示例6: shouldCheckIsAnyIsBool

 /**
  * @test
  */
 public function shouldCheckIsAnyIsBool()
 {
     //given
     $array = array('a', true, 'c');
     //when
     $any = Arrays::any($array, function ($element) {
         return is_bool($element);
     });
     //then
     $this->assertTrue($any);
 }
開發者ID:letsdrink,項目名稱:ouzo,代碼行數:14,代碼來源:ArraysTest.php

示例7: existRouteRule

 private static function existRouteRule($methods, $uri)
 {
     $routeKeys = Route::$routeKeys;
     return Arrays::any($methods, function ($method) use($routeKeys, $uri) {
         return Arrays::keyExists($routeKeys, $method . $uri);
     });
 }
開發者ID:letsdrink,項目名稱:ouzo,代碼行數:7,代碼來源:Route.php


注:本文中的Ouzo\Utilities\Arrays::any方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。