forked from centurion-project/Centurion
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
59 additions
and
3 deletions.
There are no files selected for viewing
38 changes: 38 additions & 0 deletions
38
library/Centurion/Contrib/core/traits/Order/Model/DbTable.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?php | ||
|
||
class Core_Traits_Order_Model_DbTable extends Centurion_Traits_Model_DbTable_Abstract | ||
{ | ||
|
||
protected $_requiredColumns = array('order'); | ||
|
||
public function init() | ||
{ | ||
Centurion_Signal::factory('on_select_joinInner')->connect(array($this, 'onJoinInner'), $this->_model->getSelectClass()); | ||
} | ||
|
||
/** | ||
* add filters to the default select query | ||
* @param $select Zend_Db_Table_Select | ||
* @see Core_Traits_Version_Model_DbTable::onSelect() | ||
*/ | ||
public function onJoinInner($signal, $sender, $select, $name) | ||
{ | ||
if (!$select instanceof Centurion_Db_Table_Select) { | ||
return; | ||
} | ||
|
||
if (is_array($name)) { | ||
$name = current($name); | ||
} | ||
|
||
if ($name !== $this->_model->info(Zend_Db_Table_Abstract::NAME)) { | ||
return; | ||
} | ||
|
||
if (!Centurion_Db_Table_Abstract::getFiltersStatus()) { | ||
return; | ||
} | ||
|
||
$select->order('auth_user.order asc'); | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
library/Centurion/Contrib/core/traits/Order/Model/DbTable/Interface.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?php | ||
|
||
interface Core_Traits_Order_Model_DbTable_Interface | ||
{ | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters