Skip to content
This repository has been archived by the owner on Oct 8, 2023. It is now read-only.

Commit

Permalink
fix #16: usage of yii\base\Object changed to yii\base\BaseObject
Browse files Browse the repository at this point in the history
  • Loading branch information
leandrogehlen committed Jan 16, 2018
1 parent 1c97753 commit a98305d
Show file tree
Hide file tree
Showing 4 changed files with 947 additions and 18 deletions.
19 changes: 9 additions & 10 deletions TreeColumn.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,21 @@
namespace leandrogehlen\treegrid;

use Closure;
use Yii;
use yii\base\Model;
use yii\base\Object;
use yii\base\BaseObject;
use yii\data\ActiveDataProvider;
use yii\db\ActiveQueryInterface;
use yii\helpers\ArrayHelper;
use yii\helpers\Html;
use yii\helpers\Inflector;
use yii\helpers\ArrayHelper;

/**
* Column is the base class of all [[TreeGrid]] column classes.
* The code was based in: https://github.com/yiisoft/yii2/blob/master/framework/grid/DataColumn.php
*
* @author Leandro Gehlen <[email protected]>
*/
class TreeColumn extends Object
class TreeColumn extends BaseObject
{
/**
* @var TreeGrid the grid view object that owns this column.
Expand All @@ -44,7 +43,7 @@ class TreeColumn extends Object
public $content;

/**
* @var boolean whether this column is visible. Defaults to true.
* @var bool whether this column is visible. Defaults to true.
*/
public $visible = true;

Expand Down Expand Up @@ -96,7 +95,7 @@ class TreeColumn extends Object
public $label;

/**
* @var boolean whether the header label should be HTML-encoded.
* @var bool whether the header label should be HTML-encoded.
* @see label
*/
public $encodeLabel = true;
Expand Down Expand Up @@ -145,7 +144,7 @@ public function renderFooterCell()
* Renders a data cell.
* @param mixed $model the data model being rendered
* @param mixed $key the key associated with the data model
* @param integer $index the zero-based index of the data item among the item array returned by [[GridView::dataProvider]].
* @param int $index the zero-based index of the data item among the item array returned by [[GridView::dataProvider]].
* @return string the rendering result
*/
public function renderDataCell($model, $key, $index)
Expand Down Expand Up @@ -208,7 +207,7 @@ protected function renderFooterCellContent()
* Renders the data cell content.
* @param mixed $model the data model
* @param mixed $key the key associated with the data model
* @param integer $index the zero-based index of the data model among the models array returned by [[GridView::dataProvider]].
* @param int $index the zero-based index of the data model among the models array returned by [[GridView::dataProvider]].
* @return string the rendering result
*/
protected function renderDataCellContent($model, $key, $index)
Expand All @@ -228,7 +227,7 @@ protected function renderDataCellContent($model, $key, $index)
* Returns the data cell value.
* @param mixed $model the data model
* @param mixed $key the key associated with the data model
* @param integer $index the zero-based index of the data model among the models array returned by [[GridView::dataProvider]].
* @param int $index the zero-based index of the data model among the models array returned by [[GridView::dataProvider]].
* @return string the data cell value
*/
public function getDataCellValue($model, $key, $index)
Expand All @@ -244,4 +243,4 @@ public function getDataCellValue($model, $key, $index)
}
return null;
}
}
}
14 changes: 7 additions & 7 deletions TreeGrid.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

namespace leandrogehlen\treegrid;

use Closure;
use Yii;
use yii\base\InvalidConfigException;
use Closure;
use yii\base\Widget;
use yii\base\InvalidConfigException;
use yii\grid\DataColumn;
use yii\helpers\ArrayHelper;
use yii\helpers\Html;
use yii\helpers\Json;
use yii\helpers\ArrayHelper;
use yii\i18n\Formatter;

/**
Expand Down Expand Up @@ -72,15 +72,15 @@ class TreeGrid extends Widget
public $emptyTextOptions = ['class' => 'empty'];

/**
* @var boolean whether to show the header section of the grid table.
* @var bool whether to show the header section of the grid table.
*/
public $showHeader = true;
/**
* @var boolean whether to show the footer section of the grid table.
* @var bool whether to show the footer section of the grid table.
*/
public $showFooter = false;
/**
* @var boolean whether to show the grid view if [[dataProvider]] returns no data.
* @var bool whether to show the grid view if [[dataProvider]] returns no data.
*/
public $showOnEmpty = true;

Expand Down Expand Up @@ -407,4 +407,4 @@ protected function normalizeData(array $data, $parentId = null) {
}
return $result;
}
}
}
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
}
],
"require": {
"yiisoft/yii2": "2.0.*",
"yiisoft/yii2": "~2.0.13",
"bower-asset/jquery-treegrid": "0.3.0"
},
"require-dev": {
Expand Down
Loading

0 comments on commit a98305d

Please sign in to comment.