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


PHP Arrays::filterNotBlank方法代碼示例

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


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

示例1: _buildWhereKeys

 private static function _buildWhereKeys($params)
 {
     $keys = array();
     foreach ($params as $column => $value) {
         $keys[] = self::_buildWhereKey($column, $value);
     }
     return Arrays::filterNotBlank($keys);
 }
開發者ID:letsdrink,項目名稱:ouzo,代碼行數:8,代碼來源:ArrayWhereClause.php

示例2: showSuccess

function showSuccess(array $notices = array())
{
    if (Session::has('messages') || $notices) {
        $sessionMessages = Arrays::filterNotBlank(Arrays::toArray(Session::get('messages')));
        $notices = array_merge($sessionMessages, $notices);
        $noticeView = new View('success_alert');
        $noticeView->notices = $notices;
        return $noticeView->render();
    }
    return null;
}
開發者ID:letsdrink,項目名稱:ouzo,代碼行數:11,代碼來源:ViewHelper.php

示例3: parse

 public static function parse($data)
 {
     $array = array();
     $items = Arrays::filterNotBlank(explode(',', $data));
     foreach ($items as $item) {
         $elements = explode(';', $item);
         $media = Arrays::first($elements);
         $params = array_slice($elements, 1);
         list($type, $subtype) = Arrays::map(explode('/', $media), Functions::trim());
         $q = Arrays::getValue(self::extractParams($params), 'q');
         $array[] = array('type' => $type, 'subtype' => $subtype, 'q' => $q);
     }
     usort($array, '\\Ouzo\\Http\\AcceptHeaderParser::_compare');
     return Arrays::toMap($array, function ($input) {
         return $input['type'] . '/' . $input['subtype'];
     }, function ($input) {
         return $input['q'];
     });
 }
開發者ID:letsdrink,項目名稱:ouzo,代碼行數:19,代碼來源:AcceptHeaderParser.php

示例4: filterNotBlank

 public function filterNotBlank()
 {
     $this->_array = Arrays::filterNotBlank($this->_array);
     return $this;
 }
開發者ID:phogl,項目名稱:autoloader,代碼行數:5,代碼來源:FluentArray.php

示例5: shouldFilterNotBlank

 /**
  * @test
  */
 public function shouldFilterNotBlank()
 {
     //given
     $array = array(0 => 'foo', 1 => false, 2 => -1, 3 => null, 4 => '');
     //when
     $filtered = Arrays::filterNotBlank($array);
     //then
     Assert::thatArray($filtered)->hasSize(2)->contains('foo', -1);
 }
開發者ID:letsdrink,項目名稱:ouzo,代碼行數:12,代碼來源:ArraysTest.php

示例6: getClassNamespace

 public function getClassNamespace()
 {
     $parts = explode('\\', $this->namespace);
     $parts = Arrays::map($parts, 'ucfirst');
     $modelNamespace = trim(AutoloadNamespaces::getModelNamespace(), '\\');
     if (!Strings::startsWith($this->namespace, $modelNamespace)) {
         $parts = array_merge(array($modelNamespace), $parts);
     }
     $parts = Arrays::filterNotBlank($parts);
     return implode('\\', $parts);
 }
開發者ID:letsdrink,項目名稱:ouzo,代碼行數:11,代碼來源:Generator.php

示例7: getValueRecursively

 /**
  * @param mixed $object
  * @param string $names
  * @param null|mixed $default
  * @param bool $accessPrivate
  * @return mixed|null
  */
 public static function getValueRecursively($object, $names, $default = null, $accessPrivate = false)
 {
     $fields = Arrays::filterNotBlank(explode('->', $names));
     foreach ($fields as $field) {
         $object = self::getValueOrCallMethod($object, $field, null, $accessPrivate);
         if ($object === null) {
             return $default;
         }
     }
     return $object;
 }
開發者ID:letsdrink,項目名稱:ouzo,代碼行數:18,代碼來源:Objects.php

示例8: buildWhereQuery

 public static function buildWhereQuery($whereClauses)
 {
     $parts = FluentArray::from($whereClauses)->filter(WhereClause::isNotEmptyFunction())->map('\\Ouzo\\Db\\Dialect\\DialectUtil::buildWhereQueryPart')->toArray();
     return implode(' AND ', Arrays::filterNotBlank($parts));
 }
開發者ID:letsdrink,項目名稱:ouzo,代碼行數:5,代碼來源:DialectUtil.php


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