src/Controller/Component/CrudComponent.php
public function defaults($type, $name, $config = null)
    {
        if ($config !== null) {
            if (!is_array($name)) {
                $name = [$name];
            }

            foreach ($name as $realName) {
                $this->setConfig(sprintf('%s.%s', $type, $realName), $config);
            }

            return null;
        }

        return $this->getConfig(sprintf('%s.%s', $type, $name));
    }
public function defaults($type, $name, $config = null)
    {
        if ($config !== null) {
            if (!is_array($name)) {
                $name = [$name];
            }

            foreach ($name as $realName) {
                $this->setConfig(sprintf('%s.%s', $type, $realName), $config);
            }

            return null;
        }

        return $this->getConfig(sprintf('%s.%s', $type, $name));
    }
public function defaults ( $ type , $ name , $ config = null ) { if ( $ config !== null ) { if ( ! is_array ( $ name ) ) { $ name = [ $ name ] ; } foreach ( $ name as $ realName ) { $ this -> setConfig ( sprintf ( '%s.%s' , $ type , $ realName ) , $ config ) ; } return null ; } return $ this -> getConfig ( sprintf ( '%s.%s' , $ type , $ name ) ) ; }
Set or get defaults for listeners and actions.

@param string $type Can be anything, but 'listeners' or 'actions' is currently only used.
@param string|array $name The name of the $type - e.g. 'api', 'relatedModels'
or an array ('api', 'relatedModels'). If $name is an array, the $config will be applied
to each entry in the $name array.
@param mixed $config If NULL, the defaults is returned, else the defaults are changed.
@return mixed
Set or get defaults for listeners and actions .