Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

Rev 1841 | Rev 1843 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1841 Rev 1842
Línea 3... Línea 3...
3
 
3
 
Línea 4... Línea 4...
4
namespace LeadersLinked\Mapper;
4
namespace LeadersLinked\Mapper;
5
 
5
 
6
use LeadersLinked\Mapper\Common\MapperCommon;
6
use LeadersLinked\Mapper\Common\MapperCommon;
7
use Laminas\Db\Adapter\AdapterInterface;
7
use Laminas\Db\Adapter\AdapterInterface;
8
use LeadersLinked\Model\Topics;
8
use LeadersLinked\Model\Topic;
9
use LeadersLinked\Hydrator\ObjectPropertyHydrator;
9
use LeadersLinked\Hydrator\ObjectPropertyHydrator;
10
use Laminas\Paginator\Paginator;
10
use Laminas\Paginator\Paginator;
Línea 11... Línea 11...
11
use Laminas\Db\ResultSet\HydratingResultSet;
11
use Laminas\Db\ResultSet\HydratingResultSet;
12
use Laminas\Paginator\Adapter\DbSelect;
12
use Laminas\Paginator\Adapter\DbSelect;
13
 
13
 
Línea 14... Línea 14...
14
 
14
 
15
class TopicsMapper extends MapperCommon
15
class TopicMapper extends MapperCommon
16
{
16
{
17
    const _TABLE = 'tbl_topics';
17
    const _TABLE = 'tbl_topics';
18
    
18
    
Línea 19... Línea 19...
19
    /**
19
    /**
20
     *
20
     *
Línea 32... Línea 32...
32
    }
32
    }
Línea 33... Línea 33...
33
    
33
    
34
    /**
34
    /**
35
     *
35
     *
36
     * @param AdapterInterface $adapter
36
     * @param AdapterInterface $adapter
37
     * @return TopicsMapper
37
     * @return TopicMapper
38
     */
38
     */
39
    public static function getInstance($adapter)
39
    public static function getInstance($adapter)
40
    {
40
    {
41
        if(self::$_instance == null) {
41
        if(self::$_instance == null) {
42
            self::$_instance = new TopicsMapper($adapter);
42
            self::$_instance = new TopicMapper($adapter);
43
        }
43
        }
44
        return self::$_instance;
44
        return self::$_instance;
Línea 45... Línea 45...
45
    }
45
    }
46
    
46
    
47
    /**
47
    /**
48
     * 
48
     * 
49
     * @param int $id
49
     * @param int $id
50
     * @return Topics
50
     * @return Topic
51
     */
51
     */
52
    public function fetchOne($id)
52
    public function fetchOne($id)
Línea 53... Línea 53...
53
    {
53
    {
54
        $prototype = new Topics();
54
        $prototype = new Topic();
Línea 55... Línea 55...
55
        
55
        
Línea 61... Línea 61...
61
    
61
    
62
    
62
    
63
    /**
63
    /**
64
     *
64
     *
65
     * @param int $uuid
65
     * @param int $uuid
66
     * @return Topics
66
     * @return Topic
67
     */
67
     */
68
    public function fetchOneByUuid($uuid)
68
    public function fetchOneByUuid($uuid)
69
    {
69
    {
70
        $prototype = new Topics();
70
        $prototype = new Topic();
71
        $select = $this->sql->select(self::_TABLE);
71
        $select = $this->sql->select(self::_TABLE);
72
        $select->where->equalTo('uuid', $uuid);
72
        $select->where->equalTo('uuid', $uuid);
73
        echo $select->getSqlString($this->adapter->platform); exit;
73
        echo $select->getSqlString($this->adapter->platform); exit;
Línea 74... Línea 74...
74
        return $this->executeFetchOneObject($select, $prototype);
74
        return $this->executeFetchOneObject($select, $prototype);
75
    }
75
    }
76
   
76
   
Línea 77... Línea 77...
77
    
77
    
78
    public function fetchAllMyTrainer()
78
    public function fetchAllMyTrainer()
79
    {
79
    {
Línea 80... Línea 80...
80
        $prototype = new Topics;
80
        $prototype = new Topic;
81
        
81
        
Línea 82... Línea 82...
82
        $select = $this->sql->select(self::_TABLE);
82
        $select = $this->sql->select(self::_TABLE);
83
        $select->where->equalTo('status', Topics::TYPE_MYT);
83
        $select->where->equalTo('status', Topic::TYPE_MYT);
84
        $select->order('id');
84
        $select->order('id');
Línea 85... Línea 85...
85
        
85
        
86
        return $this->executeFetchAllObject($select, $prototype);
86
        return $this->executeFetchAllObject($select, $prototype);
87
    }
87
    }
Línea 88... Línea 88...
88
 
88
 
89
    public function fetchAllHighPerfromanceGroup()
89
    public function fetchAllHighPerfromanceGroup()
Línea 90... Línea 90...
90
    {
90
    {
91
        $prototype = new Topics;
91
        $prototype = new Topic;
92
        
92
        
Línea 93... Línea 93...
93
        $select = $this->sql->select(self::_TABLE);
93
        $select = $this->sql->select(self::_TABLE);
94
        $select->where->equalTo('status', Topics::TYPE_HPTG);
94
        $select->where->equalTo('status', Topic::TYPE_HPTG);
95
        $select->order('id');
95
        $select->order('id');
Línea 96... Línea 96...
96
        
96
        
97
        return $this->executeFetchAllObject($select, $prototype);
97
        return $this->executeFetchAllObject($select, $prototype);
Línea 98... Línea 98...
98
    }
98
    }
99
 
99
 
100
    public function fetchAllHighPerfromanceForo()
100
    public function fetchAllHighPerfromanceForo()
101
    {
101
    {
102
        $prototype = new Topics;
102
        $prototype = new Topic;
103
        
103
        
104
        $select = $this->sql->select(self::_TABLE);
104
        $select = $this->sql->select(self::_TABLE);
105
        $select->where->equalTo('status', Topics::TYPE_HPTGF);
105
        $select->where->equalTo('status', Topic::TYPE_HPTGF);
Línea 132... Línea 132...
132
        return $result;
132
        return $result;
133
    }
133
    }
Línea 134... Línea 134...
134
    
134
    
135
    /**
135
    /**
136
     *
136
     *
137
     * @param TopicsForm $form
137
     * @param TopicForm $form
138
     * @return boolean
138
     * @return boolean
139
     */
139
     */
140
    public function update($form)
140
    public function update($form)
141
    {
141
    {