for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* ResultList implementation for movies
*
* @author Sam Stenvall <[email protected]>
* @copyright Copyright © Sam Stenvall 2014-
* @license https://www.gnu.org/licenses/gpl.html The GNU General Public License v3.0
*/
class ResultListMovies extends ResultList
{
public function getColumnDefinitions()
return array(
$this->getLabelColumn(),
$this->getYearColumn(),
$this->getGenreColumn(),
$this->getRatingColumn(),
$this->getRuntimeColumn(),
$this->getDateAddedColumn(),
);
}
* Returns the column definition for the rating column
* @return array
private function getRatingColumn()
'name'=>'rating',
'header'=>Yii::t('MovieList', 'Rating'),
'value'=>function($data) {
/* @var $data Movie */
echo $data->getRating();
* Returns the column definition for the runtime column
private function getRuntimeColumn()
'name'=>'runtime',
'header'=>Yii::t('GenericList', 'Runtime'),
echo $data->getRuntimeString();
* Returns the column definition for the dateadded column
private function getDateAddedColumn()
return [
'name' => 'dateadded',
'header' => Yii::t('MovieList', 'Date added'),
'value' => function ($data) {
/** @var Movie $data */
echo $data->getDateAdded();
},
];