public function edit(array $data): PodiumResponse
    {
        $id = ArrayHelper::remove($data, 'id');

        if ($id === null) {
            throw new InsufficientDataException('ID key is missing.');
        }

        $postPollForm = $this->getForm((int)$id);

        if ($postPollForm === null) {
            throw new ModelNotFoundException('Poll of given ID can not be found.');
        }

        if (!$postPollForm->loadData($data)) {
            return PodiumResponse::error();
        }

        return $postPollForm->edit();
    }
public function edit(array $data): PodiumResponse
    {
        $id = ArrayHelper::remove($data, 'id');

        if ($id === null) {
            throw new InsufficientDataException('ID key is missing.');
        }

        $postPollForm = $this->getForm((int)$id);

        if ($postPollForm === null) {
            throw new ModelNotFoundException('Poll of given ID can not be found.');
        }

        if (!$postPollForm->loadData($data)) {
            return PodiumResponse::error();
        }

        return $postPollForm->edit();
    }
public function edit ( array $ data ) : PodiumResponse { $ id = ArrayHelper :: remove ( $ data , 'id' ) ; if ( $ id === null ) { throw new InsufficientDataException ( 'ID key is missing.' ) ; } $ postPollForm = $ this -> getForm ( ( int ) $ id ) ; if ( $ postPollForm === null ) { throw new ModelNotFoundException ( 'Poll of given ID can not be found.' ) ; } if ( ! $ postPollForm -> loadData ( $ data ) ) { return PodiumResponse :: error ( ) ; } return $ postPollForm -> edit ( ) ; }
Updates poll post.
@param array $data
@return PodiumResponse
@throws InsufficientDataException
@throws ModelNotFoundException
Updates poll post .