Skip to content

fetch #5

Description

   /**
     * @param string $hookPoint
     * @param array|object|null $parameters
     * @return false|mixed
     */
    public function fetch(string $hookPoint, array|object|null $parameters = []){
    
        if($res = current($this->hookPoints[$hookPoint]["data"]))
        {
            next($this->hookPoints[$hookPoint]["data"]);
        }
        if (!is_array($res))
            return false;

        $result = call_user_func_array(
            $this->prepareCallback($res["callback"]),
            $this->getParameters($parameters)
        );
        
        $this->setOutput($result);
        $this->log("Output-Fetch", $hookPoint);

        return $result;
    }

exemple:
while ($r = \hooks()->fetch("crm.car.update", $fields)){

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions