Class yii\debug\models\timeline\DataProvider
Inheritance | yii\debug\models\timeline\DataProvider » yii\data\ArrayDataProvider » yii\data\BaseDataProvider » yii\base\Component » yii\base\BaseObject |
---|---|
Implements | yii\base\Configurable, yii\data\DataProviderInterface |
Available since version | 2.0.8 |
Source Code | https://github.com/yiisoft/yii2-debug/blob/master/models/timeline/DataProvider.php |
DataProvider implements a data provider based on a data array.
Public Properties
Property | Type | Description | Defined By |
---|---|---|---|
$allModels | array | The data that is not paginated or sorted. | yii\data\ArrayDataProvider |
$id | string | An ID that uniquely identifies the data provider among all data providers. | yii\data\BaseDataProvider |
$key | string|callable | The column that is used as the key of the data models. | yii\data\ArrayDataProvider |
$modelClass | string | The name of the Model class that will be represented. | yii\data\ArrayDataProvider |
Protected Properties
Property | Type | Description | Defined By |
---|---|---|---|
$panel | yii\debug\panels\TimelinePanel | yii\debug\models\timeline\DataProvider |
Public Methods
Method | Description | Defined By |
---|---|---|
__call() | Calls the named method which is not a class method. | yii\base\Component |
__clone() | This method is called after the object is created by cloning an existing one. | yii\base\Component |
__construct() | DataProvider constructor. | yii\debug\models\timeline\DataProvider |
__get() | Returns the value of a component property. | yii\base\Component |
__isset() | Checks if a property is set, i.e. defined and not null. | yii\base\Component |
__set() | Sets the value of a component property. | yii\base\Component |
__unset() | Sets a component property to be null. | yii\base\Component |
attachBehavior() | Attaches a behavior to this component. | yii\base\Component |
attachBehaviors() | Attaches a list of behaviors to the component. | yii\base\Component |
behaviors() | Returns a list of behaviors that this component should behave as. | yii\base\Component |
canGetProperty() | Returns a value indicating whether a property can be read. | yii\base\Component |
canSetProperty() | Returns a value indicating whether a property can be set. | yii\base\Component |
className() | Returns the fully qualified name of this class. | yii\base\BaseObject |
detachBehavior() | Detaches a behavior from the component. | yii\base\Component |
detachBehaviors() | Detaches all behaviors from the component. | yii\base\Component |
ensureBehaviors() | Makes sure that the behaviors declared in behaviors() are attached to this component. | yii\base\Component |
getBehavior() | Returns the named behavior object. | yii\base\Component |
getBehaviors() | Returns all behaviors attached to this component. | yii\base\Component |
getColor() | Getting HEX color based on model duration | yii\debug\models\timeline\DataProvider |
getCount() | Returns the number of data models in the current page. | yii\data\BaseDataProvider |
getCssClass() | Returns item, css class | yii\debug\models\timeline\DataProvider |
getKeys() | Returns the key values associated with the data models. | yii\data\BaseDataProvider |
getLeft() | Returns the offset left item, percentage of the total width | yii\debug\models\timeline\DataProvider |
getMemory() | ` php
[
0 => string, memory usage (MB)
1 => float, Y position (percent)
] |
yii\debug\models\timeline\DataProvider |
getModels() | Returns the data models in the current page. | yii\data\BaseDataProvider |
getPagination() | Returns the pagination object used by this data provider. | yii\data\BaseDataProvider |
getRulers() | Ruler items, key milliseconds, value offset left | yii\debug\models\timeline\DataProvider |
getSort() | Returns the sorting object used by this data provider. | yii\data\BaseDataProvider |
getTime() | Returns item duration, milliseconds | yii\debug\models\timeline\DataProvider |
getTotalCount() | Returns the total number of data models. | yii\data\BaseDataProvider |
getWidth() | Returns item width percent of the total width | yii\debug\models\timeline\DataProvider |
hasEventHandlers() | Returns a value indicating whether there is any handler attached to the named event. | yii\base\Component |
hasMethod() | Returns a value indicating whether a method is defined. | yii\base\Component |
hasProperty() | Returns a value indicating whether a property is defined for this component. | yii\base\Component |
init() | {@inheritdoc} | yii\data\BaseDataProvider |
off() | Detaches an existing event handler from this component. | yii\base\Component |
on() | Attaches an event handler to an event. | yii\base\Component |
prepare() | Prepares the data models and keys. | yii\data\BaseDataProvider |
refresh() | Refreshes the data provider. | yii\data\BaseDataProvider |
setKeys() | Sets the key values associated with the data models. | yii\data\BaseDataProvider |
setModels() | Sets the data models in the current page. | yii\data\BaseDataProvider |
setPagination() | Sets the pagination for this data provider. | yii\data\BaseDataProvider |
setSort() | Sets the sort definition for this data provider. | yii\data\BaseDataProvider |
setTotalCount() | Sets the total number of data models. | yii\data\BaseDataProvider |
trigger() | Triggers an event. | yii\base\Component |
Protected Methods
Method | Description | Defined By |
---|---|---|
prepareKeys() | {@inheritdoc} | yii\data\ArrayDataProvider |
prepareModels() | {@inheritdoc} | yii\debug\models\timeline\DataProvider |
prepareTotalCount() | {@inheritdoc} | yii\data\ArrayDataProvider |
sortModels() | Sorts the data models according to the given sort definition. | yii\data\ArrayDataProvider |
Property Details
Method Details
DataProvider constructor.
public void __construct ( yii\debug\panels\TimelinePanel $panel, $config = [] ) | ||
$panel | yii\debug\panels\TimelinePanel | |
$config | array |
Getting HEX color based on model duration
public string getColor ( $model ) | ||
$model | array |
Returns item, css class
public string getCssClass ( $model ) | ||
$model | array |
Returns the offset left item, percentage of the total width
public float getLeft ( $model ) | ||
$model | array |
`
php
[
0 => string, memory usage (MB)
1 => float, Y position (percent)
]
public array|null getMemory ( $model ) | ||
$model | array |
Ruler items, key milliseconds, value offset left
public array getRulers ( $line = 10 ) | ||
$line | integer | Number of columns |
Returns item duration, milliseconds
public float getTime ( $model ) | ||
$model | array |
Returns item width percent of the total width
public float getWidth ( $model ) | ||
$model | array |
{@inheritdoc}
protected void prepareModels ( ) |