schmunk42\giiant\generators\crud\ProviderTrait::callProviderQueue PHP Method

callProviderQueue() protected method

protected callProviderQueue ( $func, $args, $generator )
    protected function callProviderQueue($func, $args, $generator)
    {
        // TODO: should be done on init, but providerList is empty
        $this->initializeProviders();
        $args = func_get_args();
        unset($args[0]);
        // walk through providers
        foreach ($this->_p as $obj) {
            if (method_exists($obj, $func)) {
                $c = call_user_func_array(array(&$obj, $func), $args);
                // until a provider returns not null
                if ($c !== null) {
                    if (is_object($args)) {
                        $argsString = get_class($args);
                    } elseif (is_array($args)) {
                        $argsString = Json::encode($args);
                    } else {
                        $argsString = $args;
                    }
                    $msg = 'Using provider ' . get_class($obj) . '::' . $func . ' ' . $argsString;
                    Yii::trace($msg, __METHOD__);
                    return $c;
                }
            }
        }
    }