Class luya\admin\ngrest\Config

Inheritanceluya\admin\ngrest\Config » yii\base\BaseObject
Implementsluya\admin\ngrest\ConfigInterface, yii\base\Configurable
Available since version1.0.0
Source Code https://github.com/luyadev/luya-module-admin/blob/master/src/ngrest/Config.php

Defines and holds an NgRest Config.

Example config array to set via setConfig().

$array = [
    'list' => [
        'firstname' => [
            'name' => 'firstname',
            'alias' => 'Vorname',
            'i18n' => false,
            'extraField' => false,
            'type' => [
                'class' => '\\admin\\ngrest\\plugins\\Text',
                'args' => ['arg1' => 'arg1_value', 'arg2' => 'arg2_value']
            ]
        ]
    ],
    'create' => [
        //...
    ]
];

Public Methods

Hide inherited methods

Method Description Defined By
__call() Calls the named method which is not a class method. yii\base\BaseObject
__construct() Constructor. yii\base\BaseObject
__get() Returns the value of an object property. yii\base\BaseObject
__isset() Checks if a property is set, i.e. defined and not null. yii\base\BaseObject
__set() Sets value of an object property. yii\base\BaseObject
__unset() Sets an object property to null. yii\base\BaseObject
addField() luya\admin\ngrest\Config
appendFieldOption() luya\admin\ngrest\Config
canGetProperty() Returns a value indicating whether a property can be read. yii\base\BaseObject
canSetProperty() Returns a value indicating whether a property can be set. yii\base\BaseObject
className() Returns the fully qualified name of this class. yii\base\BaseObject
createField() Create a plugin object cased on a field array config. luya\admin\ngrest\Config
getActiveButtons() Get an array with the button configuration like hash, label and icon. luya\admin\ngrest\Config
getActiveSelections() Returns an array with object instance of {{luya\admin\ngrest\base\ActiveSelection}} luya\admin\ngrest\Config
getApiEndpoint() luya\admin\ngrest\Config
getAttributeGroups() luya\admin\ngrest\Config
getConfig() luya\admin\ngrest\Config
getDefaultOrder() Returns an array with default order options. luya\admin\ngrest\Config
getDefaultOrderDirection() luya\admin\ngrest\Config
getDefaultOrderField() luya\admin\ngrest\Config
getExtraFields() Get all extra fields. luya\admin\ngrest\Config
getField() luya\admin\ngrest\Config
getFields() luya\admin\ngrest\Config
getFilters() luya\admin\ngrest\Config
getGroupByExpanded() Determine whether the groups are expanded by default or not. luya\admin\ngrest\Config
getGroupByField() luya\admin\ngrest\Config
getHash() luya\admin\ngrest\Config
getModel() Getter method for the model luya\admin\ngrest\Config
getOption() Get an option by its key from the options pointer. Define options like luya\admin\ngrest\Config
getPlugins() Get all plugins. luya\admin\ngrest\Config
getPointer() luya\admin\ngrest\Config
getPointerExtraFields() luya\admin\ngrest\Config
getPointerPlugins() Get all plugin objects for a given pointer. luya\admin\ngrest\Config
getPrimaryKey() luya\admin\ngrest\Config
getRelations() luya\admin\ngrest\Config
getTableName() luya\admin\ngrest\Config
hasField() luya\admin\ngrest\Config
hasMethod() Returns a value indicating whether a method is defined. yii\base\BaseObject
hasPointer() luya\admin\ngrest\Config
hasProperty() Returns a value indicating whether a property is defined. yii\base\BaseObject
init() Initializes the object. yii\base\BaseObject
isDeletable() Whether delete is enabled or not. luya\admin\ngrest\Config
onFinish() luya\admin\ngrest\Config
setActiveButtons() Setter method for the active button array from the model luya\admin\ngrest\Config
setActiveSelections() Set all active selection definitions luya\admin\ngrest\Config
setApiEndpoint() luya\admin\ngrest\Config
setAttributeGroups() luya\admin\ngrest\Config
setAttributeLabels() luya\admin\ngrest\Config
setConfig() luya\admin\ngrest\Config
setDefaultOrder() luya\admin\ngrest\Config
setFilters() Setter method for filters. luya\admin\ngrest\Config
setGroupByExpanded() luya\admin\ngrest\Config
setGroupByField() luya\admin\ngrest\Config
setModel() Setter methdo for ngrest model context. luya\admin\ngrest\Config
setPrimaryKey() luya\admin\ngrest\Config
setRelation() luya\admin\ngrest\Config
setTableName() luya\admin\ngrest\Config

Property Details

Hide inherited properties

$activeButtons public property (available since version 1.2.3)

An array with hash, label and icon key.

public array getActiveButtons ( )
public void setActiveButtons ( array $buttons )
$activeSelections public property (available since version 4.0.0)
$apiEndpoint public property
public void getApiEndpoint ( )
public void setApiEndpoint ( $apiEndpoint )
$attributeGroups public property
public void getAttributeGroups ( )
public void setAttributeGroups ( array $groups )
$attributeLabels public write-only property
public void setAttributeLabels ( array $labels )
$config public property
public void getConfig ( )
public void setConfig ( array $config )
$defaultOrder public property
public array getDefaultOrder ( )
public void setDefaultOrder ( $defaultOrder )
$defaultOrderDirection public read-only property
public void getDefaultOrderDirection ( )
$defaultOrderField public read-only property
public void getDefaultOrderField ( )
$extraFields public read-only property
$filters public property
public void getFilters ( )
public void setFilters ( array $filters )
$groupByExpanded public property (available since version 1.2.2.1)
public boolean getGroupByExpanded ( )
public void setGroupByExpanded ( $groupByExpanded )
$groupByField public property
public void getGroupByField ( )
public void setGroupByField ( $groupByField )
$hash public read-only property
public void getHash ( )
$model public property
$plugins public read-only property
public array getPlugins ( )
$primaryKey public property
public void getPrimaryKey ( )
public void setPrimaryKey ( array $key )
$relation public write-only property
$relations public read-only property
public void getRelations ( )
$tableName public property
public void getTableName ( )
public void setTableName ( $tableName )

Method Details

Hide inherited methods

__call() public method

Defined in: yii\base\BaseObject::__call()

Calls the named method which is not a class method.

Do not call this method directly as it is a PHP magic method that will be implicitly called when an unknown method is being invoked.

public mixed __call ( $name, $params )
$name string

The method name

$params array

Method parameters

return mixed

The method return value

throws yii\base\UnknownMethodException

when calling unknown method

                public function __call($name, $params)
{
    throw new UnknownMethodException('Calling unknown method: ' . get_class($this) . "::$name()");
}

            
__construct() public method

Defined in: yii\base\BaseObject::__construct()

Constructor.

The default implementation does two things:

  • Initializes the object with the given configuration $config.
  • Call init().

If this method is overridden in a child class, it is recommended that

  • the last parameter of the constructor is a configuration array, like $config here.
  • call the parent implementation at the end of the constructor.
public void __construct ( $config = [] )
$config array

Name-value pairs that will be used to initialize the object properties

                public function __construct($config = [])
{
    if (!empty($config)) {
        Yii::configure($this, $config);
    }
    $this->init();
}

            
__get() public method

Defined in: yii\base\BaseObject::__get()

Returns the value of an object property.

Do not call this method directly as it is a PHP magic method that will be implicitly called when executing $value = $object->property;.

See also __set().

public mixed __get ( $name )
$name string

The property name

return mixed

The property value

throws yii\base\UnknownPropertyException

if the property is not defined

throws yii\base\InvalidCallException

if the property is write-only

                public function __get($name)
{
    $getter = 'get' . $name;
    if (method_exists($this, $getter)) {
        return $this->$getter();
    } elseif (method_exists($this, 'set' . $name)) {
        throw new InvalidCallException('Getting write-only property: ' . get_class($this) . '::' . $name);
    }
    throw new UnknownPropertyException('Getting unknown property: ' . get_class($this) . '::' . $name);
}

            
__isset() public method

Defined in: yii\base\BaseObject::__isset()

Checks if a property is set, i.e. defined and not null.

Do not call this method directly as it is a PHP magic method that will be implicitly called when executing isset($object->property).

Note that if the property is not defined, false will be returned.

See also https://www.php.net/manual/en/function.isset.php.

public boolean __isset ( $name )
$name string

The property name or the event name

return boolean

Whether the named property is set (not null).

                public function __isset($name)
{
    $getter = 'get' . $name;
    if (method_exists($this, $getter)) {
        return $this->$getter() !== null;
    }
    return false;
}

            
__set() public method

Defined in: yii\base\BaseObject::__set()

Sets value of an object property.

Do not call this method directly as it is a PHP magic method that will be implicitly called when executing $object->property = $value;.

See also __get().

public void __set ( $name, $value )
$name string

The property name or the event name

$value mixed

The property value

throws yii\base\UnknownPropertyException

if the property is not defined

throws yii\base\InvalidCallException

if the property is read-only

                public function __set($name, $value)
{
    $setter = 'set' . $name;
    if (method_exists($this, $setter)) {
        $this->$setter($value);
    } elseif (method_exists($this, 'get' . $name)) {
        throw new InvalidCallException('Setting read-only property: ' . get_class($this) . '::' . $name);
    } else {
        throw new UnknownPropertyException('Setting unknown property: ' . get_class($this) . '::' . $name);
    }
}

            
__unset() public method

Defined in: yii\base\BaseObject::__unset()

Sets an object property to null.

Do not call this method directly as it is a PHP magic method that will be implicitly called when executing unset($object->property).

Note that if the property is not defined, this method will do nothing. If the property is read-only, it will throw an exception.

See also https://www.php.net/manual/en/function.unset.php.

public void __unset ( $name )
$name string

The property name

throws yii\base\InvalidCallException

if the property is read only.

                public function __unset($name)
{
    $setter = 'set' . $name;
    if (method_exists($this, $setter)) {
        $this->$setter(null);
    } elseif (method_exists($this, 'get' . $name)) {
        throw new InvalidCallException('Unsetting read-only property: ' . get_class($this) . '::' . $name);
    }
}

            
addField() public method

public boolean addField ( $pointer, $field, array $options = [] )
$pointer string
$field string
$options array

                public function addField($pointer, $field, array $options = [])
{
    if ($this->hasField($pointer, $field)) {
        return false;
    }
    $options = ArrayHelper::merge([
        'name' => null,
        'i18n' => false,
        'alias' => null,
        'type' => null,
        'extraField' => false,
    ], $options);
    // can not unshift non array value, create array for this pointer.
    if (empty($this->_config[$pointer])) {
        $this->_config[$pointer] = [];
    }
    $this->_config[$pointer] = ArrayHelper::arrayUnshiftAssoc($this->_config[$pointer], $field, $options);
    return true;
}

            
appendFieldOption() public method

public void appendFieldOption ( $fieldName, $optionKey, $optionValue )
$fieldName string
$optionKey string
$optionValue string

                public function appendFieldOption($fieldName, $optionKey, $optionValue)
{
    foreach ($this->getConfig() as $pointer => $fields) {
        if (is_array($fields)) {
            foreach ($fields as $field) {
                if (isset($field['name'])) {
                    if ($field['name'] == $fieldName) {
                        $this->_config[$pointer][$field['name']][$optionKey] = $optionValue;
                    }
                }
            }
        }
    }
}

            
canGetProperty() public method

Defined in: yii\base\BaseObject::canGetProperty()

Returns a value indicating whether a property can be read.

A property is readable if:

  • the class has a getter method associated with the specified name (in this case, property name is case-insensitive);
  • the class has a member variable with the specified name (when $checkVars is true);

See also canSetProperty().

public boolean canGetProperty ( $name, $checkVars true )
$name string

The property name

$checkVars boolean

Whether to treat member variables as properties

return boolean

Whether the property can be read

                public function canGetProperty($name, $checkVars = true)
{
    return method_exists($this, 'get' . $name) || $checkVars && property_exists($this, $name);
}

            
canSetProperty() public method

Defined in: yii\base\BaseObject::canSetProperty()

Returns a value indicating whether a property can be set.

A property is writable if:

  • the class has a setter method associated with the specified name (in this case, property name is case-insensitive);
  • the class has a member variable with the specified name (when $checkVars is true);

See also canGetProperty().

public boolean canSetProperty ( $name, $checkVars true )
$name string

The property name

$checkVars boolean

Whether to treat member variables as properties

return boolean

Whether the property can be written

                public function canSetProperty($name, $checkVars = true)
{
    return method_exists($this, 'set' . $name) || $checkVars && property_exists($this, $name);
}

            
className() public static method
Deprecated since 2.0.14. On PHP >=5.5, use ::class instead.

Defined in: yii\base\BaseObject::className()

Returns the fully qualified name of this class.

public static string className ( )
return string

The fully qualified name of this class.

                public static function className()
{
    return get_called_class();
}

            
createField() public static method (available since version 2.0.0)

Create a plugin object cased on a field array config.

public static luya\admin\ngrest\base\Plugin createField ( array $plugin )
$plugin array

                public static function createField(array $plugin)
{
    return NgRest::createPluginObject($plugin['type']['class'], $plugin['name'], $plugin['alias'], $plugin['i18n'], $plugin['type']['args']);
}

            
getActiveButtons() public method (available since version 1.2.3)

Get an array with the button configuration like hash, label and icon.

public array getActiveButtons ( )
return array

An array with hash, label and icon key.

                public function getActiveButtons()
{
    if ($this->_activeButtons === null) {
        $buttons = $this->model->ngRestActiveButtons();
        $btns = [];
        foreach ($buttons as $button) {
            $hash = sha1($button['class']);
            $object = Yii::createObject($button);
            $btns[] = [
                'hash' => $hash,
                'label' => $object->getLabel(),
                'icon' => $object->getIcon(),
                'condition' => $object->getCondition(),
                'permissionLevel' => $object->getPermissionLevel(),
            ];
        }
        $this->_activeButtons = $btns;
    }
    return $this->_activeButtons;
}

            
getActiveSelections() public method (available since version 4.0.0)

Returns an array with object instance of {{luya\admin\ngrest\base\ActiveSelection}}

public luya\admin\ngrest\base\ActiveSelection[] getActiveSelections ( )

                public function getActiveSelections()
{
    return $this->_activeSelections;
}

            
getApiEndpoint() public method

public void getApiEndpoint ( )

                public function getApiEndpoint()
{
    return $this->_apiEndpoint;
}

            
getAttributeGroups() public method

public void getAttributeGroups ( )

                public function getAttributeGroups()
{
    return $this->_attributeGroups;
}

            
getConfig() public method

public void getConfig ( )

                public function getConfig()
{
    return $this->_config;
}

            
getDefaultOrder() public method

Returns an array with default order options.

public array getDefaultOrder ( )

                public function getDefaultOrder()
{
    return $this->_defaultOrder;
}

            
getDefaultOrderDirection() public method

public void getDefaultOrderDirection ( )

                public function getDefaultOrderDirection()
{
    if (!$this->getDefaultOrder()) {
        return false;
    }
    $direction = is_array($this->getDefaultOrder()) ? current($this->getDefaultOrder()) : null; // us preg split to find in string?
    if ($direction == SORT_ASC || strtolower($direction) == 'asc') {
        return '+';
    }
    if ($direction == SORT_DESC || strtolower($direction) == 'desc') {
        return '-';
    }
    return '+';
}

            
getDefaultOrderField() public method

public void getDefaultOrderField ( )

                public function getDefaultOrderField()
{
    if (!$this->getDefaultOrder()) {
        return false;
    }
    return key($this->getDefaultOrder());
}

            
getExtraFields() public method

Get all extra fields.

public array getExtraFields ( )

                public function getExtraFields()
{
    if ($this->_extraFields === null) {
        $extraFields = [];
        foreach ($this->getConfig() as $pointer => $fields) {
            if (is_array($fields)) {
                foreach ($fields as $field) {
                    if (isset($field['extraField']) && $field['extraField']) {
                        if (!array_key_exists($field['name'], $extraFields)) {
                            $extraFields[] = $field['name'];
                        }
                    }
                }
            }
        }
        $this->_extraFields = $extraFields;
    }
    return $this->_extraFields;
}

            
getField() public method

public boolean getField ( $pointer, $field )
$pointer string
$field string

                public function getField($pointer, $field)
{
    return $this->hasField($pointer, $field) ? $this->_config[$pointer][$field] : false;
}

            
getFields() public method

public boolean[] getFields ( $pointer, array $fields )
$pointer string
$fields array

                public function getFields($pointer, array $fields)
{
    $data = [];
    foreach ($fields as $fieldName) {
        if ($this->getField($pointer, $fieldName)) {
            $data[$fieldName] = $this->getField($pointer, $fieldName);
        }
    }
    return $data;
}

            
getFilters() public method

public void getFilters ( )

                public function getFilters()
{
    if ($this->_filters === null) {
        $this->_filters = $this->model->ngRestFilters();
    }
    return $this->_filters;
}

            
getGroupByExpanded() public method (available since version 1.2.2.1)

Determine whether the groups are expanded by default or not.

If enabled, the groups are expanded otherwise they are collapsed.

public boolean getGroupByExpanded ( )

                public function getGroupByExpanded()
{
    return $this->_groupByExpanded;
}

            
getGroupByField() public method

public void getGroupByField ( )

                public function getGroupByField()
{
    return $this->_groupByField;
}

            
getHash() public method

public void getHash ( )

                public function getHash()
{
    if ($this->_hash === null) {
        $this->_hash = md5((string) $this->getApiEndpoint());
    }
    return $this->_hash;
}

            
getModel() public method (available since version 2.4.0)

Getter method for the model

public luya\admin\ngrest\base\NgRestModel getModel ( )

                public function getModel()
{
    return $this->_model;
}

            
getOption() public method

Get an option by its key from the options pointer. Define options like

$configBuilder->options = ['saveCallback' => 'console.log(this)'];

Get the option parameter

$config->getOption('saveCallback');
public boolean getOption ( $key )
$key string

                public function getOption($key)
{
    return ($this->hasPointer('options') && array_key_exists($key, $this->_config['options'])) ? $this->_config['options'][$key] : false;
}

            
getPlugins() public method

Get all plugins.

public array getPlugins ( )

                public function getPlugins()
{
    if ($this->_plugins === null) {
        $plugins = [];
        foreach ($this->getConfig() as $pointer => $fields) {
            if (is_array($fields)) {
                foreach ($fields as $field) {
                    if (isset($field['type'])) {
                        $fieldName = $field['name'];
                        if (!array_key_exists($fieldName, $plugins)) {
                            $plugins[$fieldName] = $field;
                        }
                    }
                }
            }
        }
        $this->_plugins = $plugins;
    }
    return $this->_plugins;
}

            
getPointer() public method

public string|array getPointer ( $pointer, $defaultValue false )
$pointer string
$defaultValue boolean
return string|array

If default value is an array, an array is returned as default value

                public function getPointer($pointer, $defaultValue = false)
{
    return $this->hasPointer($pointer) ? $this->_config[$pointer] : $defaultValue;
}

            
getPointerExtraFields() public method

public void getPointerExtraFields ( $pointer )
$pointer

                public function getPointerExtraFields($pointer)
{
    $extraFields = [];
    foreach ($this->getPointer($pointer, []) as $field) {
        if (isset($field['extraField']) && $field['extraField']) {
            $extraFields[] = $field['name'];
        }
    }
    return $extraFields;
}

            
getPointerPlugins() public method (available since version 2.0.0)

Get all plugin objects for a given pointer.

public luya\admin\ngrest\base\Plugin getPointerPlugins ( $pointer )
$pointer string

The name of the pointer (list, create, update).

return luya\admin\ngrest\base\Plugin

An array with plugin objects

                public function getPointerPlugins($pointer)
{
    $plugins = [];
    foreach ($this->getPointer($pointer, []) as $field) {
        $plugins[] = self::createField($field);
    }
    return $plugins;
}

            
getPrimaryKey() public method

public void getPrimaryKey ( )

                public function getPrimaryKey()
{
    if ($this->_primaryKey === null) {
        $this->_primaryKey = $this->model->getNgRestPrimaryKey();
    }
    return $this->_primaryKey;
}

            
getRelations() public method

public void getRelations ( )

                public function getRelations()
{
    if ($this->_relations === null) {
        // ensure relations are made not on composite table.
        if ($this->model->ngRestRelations() && (is_countable($this->getPrimaryKey()) ? count($this->getPrimaryKey()) : 0) > 1) {
            throw new InvalidConfigException("Its not allowed to have ngRestRealtions() on models with composite primary keys.");
        }
        // generate relations
        $relations = [];
        foreach ($this->model->generateNgRestRelations() as $relation) {
            /** @var $relation \luya\admin\ngrest\base\NgRestRelationInterface */
            $relations[] = [
                'label' => $relation->getLabel(),
                'apiEndpoint' => $relation->getApiEndpoint(),
                'arrayIndex' => $relation->getArrayIndex(),
                'modelClass' => $relation->getModelClass(),
                'tabLabelAttribute' => $relation->getTabLabelAttribute(),
                'relationLink' => $relation->getRelationLink(),
            ];
        }
        $this->_relations = $relations;
    }
    return $this->_relations;
}

            
getTableName() public method

public void getTableName ( )

                public function getTableName()
{
    return $this->_tableName;
}

            
hasField() public method

public boolean hasField ( $pointer, $field )
$pointer string
$field string

                public function hasField($pointer, $field)
{
    return $this->getPointer($pointer) ? array_key_exists($field, $this->_config[$pointer]) : false;
}

            
hasMethod() public method

Defined in: yii\base\BaseObject::hasMethod()

Returns a value indicating whether a method is defined.

The default implementation is a call to php function method_exists(). You may override this method when you implemented the php magic method __call().

public boolean hasMethod ( $name )
$name string

The method name

return boolean

Whether the method is defined

                public function hasMethod($name)
{
    return method_exists($this, $name);
}

            
hasPointer() public method

public boolean hasPointer ( $pointer )
$pointer string

                public function hasPointer($pointer)
{
    return array_key_exists($pointer, $this->_config);
}

            
hasProperty() public method

Defined in: yii\base\BaseObject::hasProperty()

Returns a value indicating whether a property is defined.

A property is defined if:

  • the class has a getter or setter method associated with the specified name (in this case, property name is case-insensitive);
  • the class has a member variable with the specified name (when $checkVars is true);

See also:

public boolean hasProperty ( $name, $checkVars true )
$name string

The property name

$checkVars boolean

Whether to treat member variables as properties

return boolean

Whether the property is defined

                public function hasProperty($name, $checkVars = true)
{
    return $this->canGetProperty($name, $checkVars) || $this->canSetProperty($name, false);
}

            
init() public method

Defined in: yii\base\BaseObject::init()

Initializes the object.

This method is invoked at the end of the constructor after the object is initialized with the given configuration.

public void init ( )

                public function init()
{
}

            
isDeletable() public method

Whether delete is enabled or not.

public boolean isDeletable ( )

                public function isDeletable()
{
    return $this->getPointer('delete') === true ? true : false;
}

            
onFinish() public method

public void onFinish ( )

                public function onFinish()
{
    foreach ($this->getPrimaryKey() as $pk) {
        if (!$this->hasField('list', $pk)) {
            $alias = $pk;
            if (array_key_exists($alias, $this->_attributeLabels)) {
                $alias = $this->_attributeLabels[$alias];
            } elseif (strtolower($alias) == 'id') {
                $alias = Module::t('model_pk_id'); // use default translation for IDs if not label is given
            }
            $this->addField('list', $pk, [
                'name' => $pk,
                'alias' => $alias,
                'type' => [
                    'class' => 'luya\admin\ngrest\plugins\Number',
                    'args' => [],
                ],
            ]);
        }
    }
}

            
setActiveButtons() public method (available since version 1.2.3)

Setter method for the active button array from the model

public void setActiveButtons ( array $buttons )
$buttons

                public function setActiveButtons(array $buttons)
{
    $this->_activeButtons = $buttons;
}

            
setActiveSelections() public method (available since version 4.0.0)

Set all active selection definitions

public void setActiveSelections ( array $buttons )
$buttons array

                public function setActiveSelections(array $buttons)
{
    $objects = [];
    foreach ($buttons as $button) {
        if (!array_key_exists('class', $button)) {
            $button['class'] = ActiveSelection::class;
        }
        $objects[] = Yii::createObject($button);
    }
    $this->_activeSelections = $objects;
}

            
setApiEndpoint() public method

public void setApiEndpoint ( $apiEndpoint )
$apiEndpoint string

                public function setApiEndpoint($apiEndpoint)
{
    $this->_apiEndpoint = $apiEndpoint;
}

            
setAttributeGroups() public method

public void setAttributeGroups ( array $groups )
$groups array

                public function setAttributeGroups(array $groups)
{
    $this->_attributeGroups = $groups;
}

            
setAttributeLabels() public method

public void setAttributeLabels ( array $labels )
$labels

                public function setAttributeLabels(array $labels)
{
    $this->_attributeLabels = $labels;
}

            
setConfig() public method

public void setConfig ( array $config )
$config

                public function setConfig(array $config)
{
    if (!empty($this->_config)) {
        throw new InvalidConfigException("Unable to override an already provided Config.");
    }
    $this->_config = $config;
}

            
setDefaultOrder() public method
public void setDefaultOrder ( $defaultOrder )
$defaultOrder

                public function setDefaultOrder($defaultOrder)
{
    $this->_defaultOrder = $defaultOrder;
}

            
setFilters() public method

Setter method for filters.

public void setFilters ( array $filters )
$filters array

                public function setFilters(array $filters)
{
    $this->_filters = $filters;
}

            
setGroupByExpanded() public method (available since version 1.2.2.1)

public void setGroupByExpanded ( $groupByExpanded )
$groupByExpanded boolean

                public function setGroupByExpanded($groupByExpanded)
{
    $this->_groupByExpanded = $groupByExpanded;
}

            
setGroupByField() public method

public void setGroupByField ( $groupByField )
$groupByField string

                public function setGroupByField($groupByField)
{
    $this->_groupByField = $groupByField;
}

            
setModel() public method (available since version 2.4.0)

Setter methdo for ngrest model context.

The model that can be lazy loaded on request instead of preloading from model.

public void setModel ( luya\admin\ngrest\base\NgRestModel $model )
$model luya\admin\ngrest\base\NgRestModel

                public function setModel(NgRestModel $model)
{
    $this->_model = $model;
}

            
setPrimaryKey() public method

public void setPrimaryKey ( array $key )
$key string

                public function setPrimaryKey(array $key)
{
    $this->_primaryKey = $key;
}

            
setRelation() public method

public void setRelation ( luya\admin\ngrest\base\NgRestRelation $relation )
$relation

                public function setRelation(NgRestRelation $relation)
{
    $this->_relations[] = $relation;
}

            
setTableName() public method

public void setTableName ( $tableName )
$tableName

                public function setTableName($tableName)
{
    $this->_tableName = $tableName;
}