public -> protected $defaultAlias

This commit is contained in:
Samuel Georges 2015-02-28 12:43:53 +11:00
parent c035f81b0f
commit 85c47c4e01
17 changed files with 45 additions and 45 deletions

View File

@ -29,16 +29,16 @@ abstract class WidgetBase
*/ */
protected $controller; protected $controller;
/**
* @var string A unique alias to identify this widget.
*/
public $defaultAlias = 'widget';
/** /**
* @var string Defined alias used for this widget. * @var string Defined alias used for this widget.
*/ */
public $alias; public $alias;
/**
* @var string A unique alias to identify this widget.
*/
protected $defaultAlias = 'widget';
/** /**
* Constructor * Constructor
* @param Backend\Classes\Controller $controller * @param Backend\Classes\Controller $controller
@ -80,26 +80,6 @@ abstract class WidgetBase
} }
} }
/**
* Transfers config values stored inside the $config property directly
* on to the root object properties. If no properties are defined
* all config will be transferred if finds a match.
* @param array $properties
* @return void
*/
protected function fillFromConfig($properties = null)
{
if ($properties === null) {
$properties = array_keys((array) $this->config);
}
foreach ($properties as $property) {
if (property_exists($this, $property)) {
$this->{$property} = $this->getConfig($property, $this->{$property});
}
}
}
/** /**
* Initialize the widget, called by the constructor and free from its parameters. * Initialize the widget, called by the constructor and free from its parameters.
* @return void * @return void
@ -138,6 +118,26 @@ abstract class WidgetBase
$this->controller->widget->{$this->alias} = $this; $this->controller->widget->{$this->alias} = $this;
} }
/**
* Transfers config values stored inside the $config property directly
* on to the root object properties. If no properties are defined
* all config will be transferred if it finds a matching property.
* @param array $properties
* @return void
*/
protected function fillFromConfig($properties = null)
{
if ($properties === null) {
$properties = array_keys((array) $this->config);
}
foreach ($properties as $property) {
if (property_exists($this, $property)) {
$this->{$property} = $this->getConfig($property, $this->{$property});
}
}
}
/** /**
* Returns a unique ID for this widget. Useful in creating HTML markup. * Returns a unique ID for this widget. Useful in creating HTML markup.
* @param string $suffix An extra string to append to the ID. * @param string $suffix An extra string to append to the ID.

View File

@ -15,7 +15,7 @@ class CodeEditor extends FormWidgetBase
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
public $defaultAlias = 'codeeditor'; protected $defaultAlias = 'codeeditor';
/** /**
* @var string Code language to display (php, twig) * @var string Code language to display (php, twig)

View File

@ -14,7 +14,7 @@ class ColorPicker extends FormWidgetBase
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
public $defaultAlias = 'colorpicker'; protected $defaultAlias = 'colorpicker';
/** /**
* @var array Default available colors * @var array Default available colors

View File

@ -16,7 +16,7 @@ class DataGrid extends FormWidgetBase
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
public $defaultAlias = 'datagrid'; protected $defaultAlias = 'datagrid';
/** /**
* @var string Grid size * @var string Grid size

View File

@ -17,7 +17,7 @@ class DataTable extends FormWidgetBase
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
public $defaultAlias = 'datatable'; protected $defaultAlias = 'datatable';
/** /**
* @var string Table size * @var string Table size

View File

@ -16,7 +16,7 @@ class DatePicker extends FormWidgetBase
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
public $defaultAlias = 'datepicker'; protected $defaultAlias = 'datepicker';
/** /**
* @var bool Display mode: datetime, date, time. * @var bool Display mode: datetime, date, time.

View File

@ -27,7 +27,7 @@ class FileUpload extends FormWidgetBase
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
public $defaultAlias = 'fileupload'; protected $defaultAlias = 'fileupload';
/** /**
* @var int Preview image width * @var int Preview image width

View File

@ -24,7 +24,7 @@ class RecordFinder extends FormWidgetBase
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
public $defaultAlias = 'recordfinder'; protected $defaultAlias = 'recordfinder';
/** /**
* @var string Relationship type * @var string Relationship type

View File

@ -17,7 +17,7 @@ class Relation extends FormWidgetBase
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
public $defaultAlias = 'relation'; protected $defaultAlias = 'relation';
/** /**
* @var string Relationship type * @var string Relationship type

View File

@ -14,7 +14,7 @@ class RichEditor extends FormWidgetBase
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
public $defaultAlias = 'richeditor'; protected $defaultAlias = 'richeditor';
/** /**
* @var boolean Determines whether content has HEAD and HTML tags. * @var boolean Determines whether content has HEAD and HTML tags.

View File

@ -18,7 +18,7 @@ class Filter extends WidgetBase
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
public $defaultAlias = 'filter'; protected $defaultAlias = 'filter';
/** /**
* @var boolean Determines if scope definitions have been created. * @var boolean Determines if scope definitions have been created.

View File

@ -43,7 +43,7 @@ class Form extends WidgetBase
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
public $defaultAlias = 'form'; protected $defaultAlias = 'form';
/** /**
* @var Model Form model object. * @var Model Form model object.

View File

@ -23,7 +23,7 @@ class Grid extends WidgetBase
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
public $defaultAlias = 'grid'; protected $defaultAlias = 'grid';
/** /**
* @var array Grid columns * @var array Grid columns

View File

@ -55,6 +55,11 @@ class ReportContainer extends WidgetBase
// Object properties // Object properties
// //
/**
* {@inheritDoc}
*/
protected $defaultAlias = 'reportContainer';
/** /**
* @var array Collection of all report widgets used by this container. * @var array Collection of all report widgets used by this container.
*/ */
@ -65,11 +70,6 @@ class ReportContainer extends WidgetBase
*/ */
protected $reportsDefined = false; protected $reportsDefined = false;
/**
* {@inheritDoc}
*/
public $defaultAlias = 'reportContainer';
/** /**
* Constructor. * Constructor.
*/ */

View File

@ -15,7 +15,7 @@ class Search extends WidgetBase
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
public $defaultAlias = 'search'; protected $defaultAlias = 'search';
/** /**
* @var string Search placeholder text. * @var string Search placeholder text.

View File

@ -18,7 +18,7 @@ class Table extends WidgetBase
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
public $defaultAlias = 'table'; protected $defaultAlias = 'table';
/** /**
* @var array Table columns * @var array Table columns

View File

@ -14,7 +14,7 @@ class Toolbar extends WidgetBase
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
public $defaultAlias = 'toolbar'; protected $defaultAlias = 'toolbar';
/** /**
* @var WidgetBase Reference to the search widget object. * @var WidgetBase Reference to the search widget object.