OSDN Git Service

#17690 - Append ability list.
[mulab/sd3rd.git] / trust_path / modules / sd3rd / forms / AbilityFilterForm.class.php
1 <?php
2 /**
3  * @file
4  * @package sd3rd
5  * @version $Id$
6 **/
7
8 if(!defined('XOOPS_ROOT_PATH'))
9 {
10     exit;
11 }
12
13 require_once SD3RD_TRUST_PATH . '/class/AbstractFilterForm.class.php';
14
15 define('SD3RD_ABILITY_SORT_KEY_ABILITY_NAME', 1);
16 define('SD3RD_ABILITY_SORT_KEY_DEFAULT', SD3RD_ABILITY_SORT_KEY_ABILITY_NAME);
17
18 /**
19  * Sd3rd_AbilityFilterForm
20 **/
21 class Sd3rd_AbilityFilterForm extends Sd3rd_AbstractFilterForm
22 {
23     public /*** string[] ***/ $mSortKeys = array(
24         SD3RD_ABILITY_SORT_KEY_ABILITY_NAME => 'ability_name',
25     );
26
27     /**
28      * getDefaultSortKey
29      * 
30      * @param   void
31      * 
32      * @return  void
33     **/
34     public function getDefaultSortKey()
35     {
36         return SD3RD_ABILITY_SORT_KEY_DEFAULT;
37     }
38
39     /**
40      * fetch
41      * 
42      * @param   void
43      * 
44      * @return  void
45     **/
46     public function fetch()
47     {
48         parent::fetch();
49         $request =& XCube_Root::getSingleton()->mContext->mRequest;
50     
51         if(($value = $request->getRequest('ability_cost')) !== null)
52         {
53             if(ctype_digit($value))
54             {
55                 $value = intval($value);
56                 $this->_mCriteria->add(new Criteria('ability_cost', $value));
57             }
58             else
59             {
60                 $value = null;
61             }
62         }
63         $this->mNavi->addExtra('ability_cost', $value);
64     
65         if(($value = $request->getRequest('register_time')) !== null)
66         {
67             if(ctype_digit($value))
68             {
69                 $value = intval($value);
70                 $this->_mCriteria->add(new Criteria('register_time', $value));
71             }
72             else
73             {
74                 $value = null;
75             }
76         }
77         $this->mNavi->addExtra('register_time', $value);
78     
79         $this->_mCriteria->addSort($this->getSort(), $this->getOrder());
80     }
81 }
82
83 ?>