示例#1
0
 /**
  * @param array $idConstantsMap
  * @return array
  */
 private function getIdConstantsByTypeConstantValuesMap(array $idConstantsMap)
 {
     $result = [];
     $flipIdConstantsMap = array_flip($idConstantsMap);
     $exceptionMap = AppHttpException::getMap();
     foreach ($exceptionMap as $typeConstant => $data) {
         $constants = [];
         foreach ($data[1] as $value) {
             $constants[] = $flipIdConstantsMap[$value];
         }
         $result[$typeConstant] = $constants;
     }
     return $result;
 }
示例#2
0
    ?>
            </td>

            <td>
                <?php 
    echo isset($constantDescriptions[$const]) ? $constantDescriptions[$const] : '';
    ?>
            </td>
            <td>
                <ul>
                    <?php 
    foreach ($idConstantsByTypeConstantValuesMap[$value] as $idConstant) {
        ?>
                        <li>
                            <code><?php 
        echo trim(\app\components\exceptions\AppHttpException::getMessageByCode($idConstantsMap[$idConstant]));
        ?>
</code>(<?php 
        echo $idConstant;
        ?>
                            )
                        </li>
                    <?php 
    }
    ?>
                </ul>
            </td>
        </tr>
    <?php 
}
?>