hasArgument(self::POST_ENTITY)) { $this->post = $this->getArgument(self::POST_ENTITY); } else { $postId = $this->getArgument(self::POST_ID); $this->post = PostModel::findByIdOrName($postId); } } }