本文整理汇总了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;
}
示例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;
}
}
}