Example #1
0
 /**
  *  アクションフォームオブジェクト(helper)を取得する
  *  $action === null で $name が指定されているときは、$nameの定義を
  *  含むものを探す
  *
  *  @access protected
  *  @param  string  action  取得するアクション名
  *  @param  string  name    定義されていることを期待するフォーム名
  *  @return object  Ethna_ActionFormまたは継承オブジェクト
  */
 public function _getHelperActionForm($action = null, $name = null)
 {
     // $action が指定されている場合
     if ($action !== null) {
         if (isset($this->helper_action_form[$action]) && is_object($this->helper_action_form[$action])) {
             return $this->helper_action_form[$action];
         } else {
             $this->logger->log(LOG_WARNING, 'helper action form for action [%s] not found', $action);
             return null;
         }
     }
     // 最初に $this->af を調べる
     $def = $this->af->getDef($name);
     if ($def !== null) {
         return $this->af;
     }
     // $this->helper_action_form を順に調べる
     foreach (array_keys($this->helper_action_form) as $action) {
         if (is_object($this->helper_action_form[$action]) === false) {
             continue;
         }
         $af = $this->helper_action_form[$action];
         $def = $af->getDef($name);
         if (is_null($def) === false) {
             return $af;
         }
     }
     // 見付からなかった
     $this->logger->log(LOG_WARNING, 'action form defining form [%s] not found', $name);
     return null;
 }