Skip to content

Commit

Permalink
Enhacement: 'with' param. By b3atb0x: http://www.yiiframework.com/ext…
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgebg committed Apr 3, 2012
1 parent 9a2c918 commit 79f09ac
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions SearchAction.php
Expand Up @@ -36,11 +36,12 @@
*/ */
class SearchAction extends CAction { class SearchAction extends CAction {


public $layout; public $layout;
public $view; public $view;
public $resultView; public $resultView;
public $viewPath; public $viewPath;
public $model; public $model;
public $with = array();
public $attributes = array('title', 'tags', 'content'); public $attributes = array('title', 'tags', 'content');
public $titleAttribute; public $titleAttribute;
public $showAttributes; public $showAttributes;
Expand Down Expand Up @@ -108,7 +109,7 @@ public function init() {
$searched = $this->getSearched(true); $searched = $this->getSearched(true);
if ($searched) { if ($searched) {
$criteria = $this->getCriteria(); $criteria = $this->getCriteria();
$conditions = new CDbCriteria(); $conditions = new CDbCriteria(array('with'=>$this->with));
foreach ($this->attributes as $attribute) { foreach ($this->attributes as $attribute) {
if (strpos($attribute, '.') === false) if (strpos($attribute, '.') === false)
$attribute = ($criteria->alias ? $criteria->alias : 't') . '.' . $attribute; $attribute = ($criteria->alias ? $criteria->alias : 't') . '.' . $attribute;
Expand Down

0 comments on commit 79f09ac

Please sign in to comment.