for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* @link https://github.com/paulzi/yii2-nested-intervals
* @copyright Copyright (c) 2015 PaulZi <[email protected]>
* @license MIT (https://github.com/paulzi/yii2-nested-intervals/blob/master/LICENSE)
*/
namespace paulzi\nestedintervals;
* @author PaulZi <[email protected]>
trait NestedIntervalsQueryTrait
{
* @return \yii\db\ActiveQuery
public function roots()
/** @var \yii\db\ActiveQuery $this */
$class = $this->modelClass;
$model = new $class;
return $this->andWhere([$model->leftAttribute => $model->range[0]]);
}