Permalink
Browse files

code formatting and docs

  • Loading branch information...
dogmatic69 committed Jul 16, 2013
1 parent d7a8fef commit e8f3216a61b6002f06e70561f8b8e78c108f7aa4
@@ -113,9 +113,7 @@ public function beforeFind(Model $Model, $query) {
$query['list']['keyPath'] = '{n}.' . $query['fields'][0];
$query['list']['valuePath'] = '{n}.' . $query['fields'][1];
}
else if ($Model->findQueryType == 'neighbors') {
} else if ($Model->findQueryType == 'neighbors') {
$query['fields'] = array_merge(
$query['fields'],
@@ -136,11 +134,9 @@ public function beforeFind(Model $Model, $query) {
array_unshift($query['joins'], $gc);
return $query;
}
else if ($Model->findQueryType == 'layoutList') {
} else if ($Model->findQueryType == 'layoutList') {
return $query;
}
else if ($Model->findQueryType != 'count') {
} else if ($Model->findQueryType != 'count') {
$query['fields'] = array_merge(
$query['fields'],
array(
@@ -157,8 +153,10 @@ public function beforeFind(Model $Model, $query) {
'ContentGroup.name',
'ContentEditor.id',
'ContentEditor.username',
'ContentEditor.email',
'ContentAuthor.id',
'ContentAuthor.username'
'ContentAuthor.username',
'ContentAuthor.email',
)
);
}
@@ -108,17 +108,14 @@ public function beforeValidate($options = array()) {
* @return array
*/
public function getActiveIds() {
$ids = $this->find(
'list',
array(
'fields' => array(
$this->alias . '.id', $this->alias . '.id'
),
'conditions' => array(
$this->alias . '.active' => 1
)
$ids = $this->find('list', array(
'fields' => array(
$this->alias . '.id', $this->alias . '.id'
),
'conditions' => array(
$this->alias . '.active' => 1
)
);
));
return $ids;
}
@@ -138,21 +135,15 @@ public function children($id = null, $direct = false) {
return parent::children($id, $direct);
}
$id = $this->find(
'first',
array(
'conditions' => array(
'or' => array(
'GlobalCategory.slug' => $id,
'GlobalCategory.title' => $id
),
)
)
);
if (isset($id['GlobalCategory']['id']) && !empty($id['GlobalCategory']['id'])) {
$id = $id['GlobalCategory']['id'];
}
$this->virtualFields['slug'] = 'GlobalContent.slug';
$this->virtualFields['title'] = 'GlobalContent.title';
$id = $this->field('id', array(
'or' => array(
'GlobalCategory.id' => $id,
'slug' => $id,
'title' => $id
),
));
return parent::children($id, $direct);
}
@@ -41,7 +41,6 @@ if (!isset($tags[0]['GlobalTag'])) {
$tags = $_tags;
unset($_tags);
}
if (!$tags) {
return false;
}
@@ -18,6 +18,7 @@
*/
class GlobalContentsHelper extends AppHelper {
/**
* Helpers to load
*
Oops, something went wrong.

0 comments on commit e8f3216

Please sign in to comment.