protected function checkEmptyHook($params)
    {
        $hookName = $this->getParam($params, 'rel');

        if (null == $hookName) {
            throw new \InvalidArgumentException(
                $this->translator->trans("Missing 'rel' parameter in ifhook/elsehook arguments")
            );
        }

        if (!isset($this->hookResults[$hookName])) {
            $exception = new \InvalidArgumentException(
                $this->translator->trans("Related hook name '%name' is not defined.", ['%name' => $hookName])
            );

            Tlog::getInstance()->error($exception->getMessage());

            if ($this->debug) {
                throw $exception;
            }

            return true;
        }

        return (is_string($this->hookResults[$hookName]) && '' === $this->hookResults[$hookName]
            || !is_string($this->hookResults[$hookName]) && $this->hookResults[$hookName]->isEmpty()
        );
    }
protected function checkEmptyHook($params)
    {
        $hookName = $this->getParam($params, 'rel');

        if (null == $hookName) {
            throw new \InvalidArgumentException(
                $this->translator->trans("Missing 'rel' parameter in ifhook/elsehook arguments")
            );
        }

        if (!isset($this->hookResults[$hookName])) {
            $exception = new \InvalidArgumentException(
                $this->translator->trans("Related hook name '%name' is not defined.", ['%name' => $hookName])
            );

            Tlog::getInstance()->error($exception->getMessage());

            if ($this->debug) {
                throw $exception;
            }

            return true;
        }

        return (is_string($this->hookResults[$hookName]) && '' === $this->hookResults[$hookName]
            || !is_string($this->hookResults[$hookName]) && $this->hookResults[$hookName]->isEmpty()
        );
    }
protected function checkEmptyHook ( $ params ) { $ hookName = $ this -> getParam ( $ params , 'rel' ) ; if ( null == $ hookName ) { throw new \ InvalidArgumentException ( $ this -> translator -> trans ( "Missing 'rel' parameter in ifhook/elsehook arguments" ) ) ; } if ( ! isset ( $ this -> hookResults [ $ hookName ] ) ) { $ exception = new \ InvalidArgumentException ( $ this -> translator -> trans ( "Related hook name '%name' is not defined." , [ '%name' => $ hookName ] ) ) ; Tlog :: getInstance ( ) -> error ( $ exception -> getMessage ( ) ) ; if ( $ this -> debug ) { throw $ exception ; } return true ; } return ( is_string ( $ this -> hookResults [ $ hookName ] ) && '' === $ this -> hookResults [ $ hookName ] || ! is_string ( $ this -> hookResults [ $ hookName ] ) && $ this -> hookResults [ $ hookName ] -> isEmpty ( ) ) ; }
Check if a hook has returned results. The hook should have been executed before, or an
InvalidArgumentException is thrown

@param array $params

@return boolean                   true if the hook is empty
@throws \InvalidArgumentException
Check if a hook has returned results . The hook should have been executed before or an InvalidArgumentException is thrown