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


PHP Arr::isValid方法代碼示例

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


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

示例1: getConjugationTable

 public function getConjugationTable()
 {
     $aFormatedRule = array();
     $sFeatureTense = Config::get('jsreal.feature.tense.alias');
     $sFeaturePerson = Config::get('jsreal.feature.person.alias');
     $sFeatureNumber = Config::get('jsreal.feature.number.alias');
     $sFeatureNumberPlural = Config::get('jsreal.feature.number.plural');
     $aAutocompletedTense = array();
     foreach ($this->aRawRuleList as $aRawRule) {
         $sTableId = $aRawRule[0];
         $sEnding = $aRawRule[1];
         $aConjugationList = array();
         for ($i = 2, $iLength1 = count($aRawRule); $i < $iLength1; $i++) {
             $sConjugation = $aRawRule[$i][$j = 0];
             $aInformation = array();
             for ($j = 1, $iLength2 = count($aRawRule[$i]); $j < $iLength2; $j++) {
                 $aInformation[$this->oDmConverter->getClassName($aRawRule[$i][$j])] = $this->oDmConverter->getProperName($aRawRule[$i][$j]);
             }
             if (isset($aInformation[$sFeatureTense])) {
                 if (isset($aInformation[$sFeaturePerson]) && !empty($aInformation[$sFeaturePerson])) {
                     if (empty($aConjugationList[$aInformation[$sFeatureTense]])) {
                         $aConjugationList[$aInformation[$sFeatureTense]] = array('', '', '', '', '', '');
                         //                            $aConjugationList[$aInformation[$sFeatureTense]] =
                         //                                    array($sEnding, $sEnding, $sEnding, $sEnding, $sEnding, $sEnding, );
                         $aAutocompletedTense[] = $aInformation[$sFeatureTense];
                     }
                     if (isset($aInformation[$sFeatureNumber]) && !empty($aInformation[$sFeatureNumber])) {
                         $iPosition = $aInformation[$sFeatureNumber] === $sFeatureNumberPlural ? $aInformation[$sFeaturePerson] + 3 : $aInformation[$sFeaturePerson];
                         if (empty($aConjugationList[$aInformation[$sFeatureTense]][$iPosition - 1])) {
                             $aConjugationList[$aInformation[$sFeatureTense]][$iPosition - 1] = $sConjugation;
                         }
                     } else {
                         if (empty($aConjugationList[$aInformation[$sFeatureTense]][$aInformation[$sFeaturePerson] + 3 - 1])) {
                             $aConjugationList[$aInformation[$sFeatureTense]][$aInformation[$sFeaturePerson] + 3 - 1] = $sConjugation;
                         }
                         if (empty($aConjugationList[$aInformation[$sFeatureTense]][$aInformation[$sFeaturePerson] - 1])) {
                             $aConjugationList[$aInformation[$sFeatureTense]][$aInformation[$sFeaturePerson] - 1] = $sConjugation;
                         }
                     }
                 } else {
                     if (!isset($aConjugationList[$aInformation[$sFeatureTense]])) {
                         $aConjugationList[$aInformation[$sFeatureTense]] = $sConjugation;
                     }
                 }
             }
         }
         // Pour compléter avec les terminaisons régulières
         foreach ($aConjugationList as $sTense => $aTenseConjugation) {
             if (Arr::isValid($aTenseConjugation) && Arr::in($aAutocompletedTense, $sTense)) {
                 foreach ($aTenseConjugation as $iIndex => $sCurrentConjugation) {
                     if (empty($sCurrentConjugation)) {
                         $aConjugationList[$sTense][$iIndex] = $sEnding;
                     }
                 }
             }
         }
         $aFormatedRule[$sTableId] = array('ending' => $sEnding, $sFeatureTense => $aConjugationList);
     }
     return $aFormatedRule;
 }
開發者ID:rali-udem,項目名稱:JSrealB,代碼行數:60,代碼來源:DmFormatter.php

示例2: addTableIdToVerb

 protected function addTableIdToVerb(array &$aVerbList, array &$aLexicon)
 {
     foreach ($aLexicon as $sUnit => $aInfoList) {
         if (isset($aLexicon[$sUnit]['V']) && isset($aVerbList[$sUnit])) {
             // en/fr formats support
             $uVerbInfo = $aVerbList[$sUnit];
             $aLexicon[$sUnit]['V']['tab'] = Arr::isValid($uVerbInfo) ? $uVerbInfo['tab'][0] : $uVerbInfo;
         }
     }
 }
開發者ID:rali-udem,項目名稱:JSrealB,代碼行數:10,代碼來源:JSRealService.php


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