Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

Rev 1526 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1526 Rev 3471
Línea 5... Línea 5...
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\Survey;
8
use LeadersLinked\Model\Survey;
9
use LeadersLinked\Hydrator\ObjectPropertyHydrator;
-
 
10
use Laminas\Paginator\Paginator;
-
 
11
use Laminas\Db\ResultSet\HydratingResultSet;
-
 
12
use Laminas\Paginator\Adapter\DbSelect;
9
use LeadersLinked\Hydrator\ObjectPropertyHydrator;
Línea 13... Línea 10...
13
use LeadersLinked\Model\SurveySkill;
10
use LeadersLinked\Model\SurveySkill;
14
 
11
 
15
 
12
 
Línea 16... Línea 13...
16
class SurveySkillMapper extends MapperCommon
13
class SurveySkillMapper extends MapperCommon
17
{
14
{
18
    const _TABLE = 'tbl_survey_skill';
15
    const _TABLE = 'tbl_survey_skills';
19
    
16
    
Línea 50... Línea 47...
50
     * @param int $id
47
     * @param int $id
51
     * @return Survey
48
     * @return Survey
52
     */
49
     */
53
    public function fetchOne($id)
50
    public function fetchOne($id)
54
    {
51
    {
55
        $prototype = new Survey();
52
        $prototype = new SurveySkill();
Línea 56... Línea 53...
56
        
53
        
57
        $select = $this->sql->select(self::_TABLE);
54
        $select = $this->sql->select(self::_TABLE);
Línea 58... Línea 55...
58
        $select->where->equalTo('id', $id);
55
        $select->where->equalTo('id', $id);
Línea 62... Línea 59...
62
    
59
    
63
    
60
    
64
    /**
61
    /**
65
     *
62
     *
66
     * @param int $uuid
63
     * @param int $uuid
67
     * @return Survey
64
     * @return SurveySkill
68
     */
65
     */
69
    public function fetchOneByUuid($uuid)
66
    public function fetchOneByUuid($uuid)
70
    {
67
    {
71
        $prototype = new Survey();
68
        $prototype = new SurveySkill();
Línea 72... Línea 69...
72
        $select = $this->sql->select(self::_TABLE);
69
        $select = $this->sql->select(self::_TABLE);
73
        $select->where->equalTo('uuid', $uuid);
70
        $select->where->equalTo('uuid', $uuid);
Línea 74... Línea 71...
74
        
71
        
75
        return $this->executeFetchOneObject($select, $prototype);
72
        return $this->executeFetchOneObject($select, $prototype);
76
    }
73
    }
77
   
74
   
78
    
75
    
79
    /**
76
    /**
80
     *
77
     *
81
     * @param int $survey_id
78
     * @param int $survey_id
Línea 93... Línea 90...
93
    }
90
    }
Línea 94... Línea 91...
94
    
91
    
95
    
92
    
96
    /**
93
    /**
97
     * 
94
     * 
98
     * @param $record
95
     * @param SurveySkill $record
99
     * @return boolean
96
     * @return boolean
100
     */
97
     */
101
    public function insert($record)
98
    public function insert($record)
Línea 116... Línea 113...
116
        return $result;
113
        return $result;
117
    }
114
    }
Línea 118... Línea 115...
118
    
115
    
119
    /**
116
    /**
120
     *
117
     *
121
     * @param SurveyForm $form
118
     * @param SurveySkill $record
122
     * @return boolean
119
     * @return boolean
123
     */
120
     */
124
    public function update($form)
121
    public function update($record)
125
    {
122
    {
126
        $hydrator = new ObjectPropertyHydrator();
123
        $hydrator = new ObjectPropertyHydrator();
127
        $values = $hydrator->extract($form);
124
        $values = $hydrator->extract($record);
Línea 128... Línea 125...
128
        $values = $this->removeEmpty($values);
125
        $values = $this->removeEmpty($values);
129
        
126
        
130
        $update = $this->sql->update(self::_TABLE);
127
        $update = $this->sql->update(self::_TABLE);
Línea 131... Línea 128...
131
        $update->set($values);
128
        $update->set($values);
132
        $update->where->equalTo('id', $form->id);
129
        $update->where->equalTo('id', $record->id);
Línea 133... Línea 130...
133
        
130
        
134
        return $this->executeUpdate($update); 
131
        return $this->executeUpdate($update); 
135
    }
132
    }
136
    
133
    
137
    /**
134
    /**
138
     *
135
     *
139
     * @param int $form_id
136
     * @param int $survey_id
140
     * @return boolean
137
     * @return boolean
141
     */
138
     */
Línea 142... Línea 139...
142
    public function deleteBySurevy($survey_id)
139
    public function deleteBySurveyId($survey_id)