Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 1527 Rev 3471
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;
-
 
7
use Laminas\Db\Adapter\AdapterInterface;
6
use LeadersLinked\Mapper\Common\MapperCommon;
8
use LeadersLinked\Model\Survey;
-
 
9
use LeadersLinked\Hydrator\ObjectPropertyHydrator;
-
 
10
use Laminas\Paginator\Paginator;
-
 
11
use Laminas\Db\ResultSet\HydratingResultSet;
7
use Laminas\Db\Adapter\AdapterInterface;
Línea 12... Línea 8...
12
use Laminas\Paginator\Adapter\DbSelect;
8
use LeadersLinked\Hydrator\ObjectPropertyHydrator;
13
use LeadersLinked\Model\SurveyIndustry;
9
use LeadersLinked\Model\SurveyIndustry;
14
 
10
 
Línea 15... Línea 11...
15
 
11
 
16
class SurveyIndustryMapper extends MapperCommon
12
class SurveyIndustryMapper extends MapperCommon
17
{
13
{
18
    const _TABLE = 'tbl_survey_industry';
14
    const _TABLE = 'tbl_survey_industries';
Línea 46... Línea 42...
46
    }
42
    }
Línea 47... Línea 43...
47
    
43
    
48
    /**
44
    /**
49
     * 
45
     * 
50
     * @param int $id
46
     * @param int $id
51
     * @return Survey
47
     * @return SurveyIndustry
52
     */
48
     */
53
    public function fetchOne($id)
49
    public function fetchOne($id)
54
    {
50
    {
Línea 62... Línea 58...
62
   
58
   
63
    
59
    
64
    /**
60
    /**
65
     *
61
     *
66
     * @param int $survey_id
62
     * @param int $survey_id
67
     * @return Survey
63
     * @return SurveyIndustry[]
68
     */
64
     */
69
    public function fetchAllBySurveyId($survey_id)
65
    public function fetchAllBySurveyId($survey_id)
Línea 78... Línea 74...
78
    }
74
    }
Línea 79... Línea 75...
79
    
75
    
80
    
76
    
81
    /**
77
    /**
82
     * 
78
     * 
83
     * @param $record
79
     * @param SurveyIndustry $record
84
     * @return boolean
80
     * @return boolean
85
     */
81
     */
86
    public function insert($record)
82
    public function insert($record)
Línea 101... Línea 97...
101
        return $result;
97
        return $result;
102
    }
98
    }
Línea 103... Línea 99...
103
    
99
    
104
    /**
100
    /**
105
     *
101
     *
106
     * @param SurveyForm $form
102
     * @param SurveyIndustry $record
107
     * @return boolean
103
     * @return boolean
108
     */
104
     */
109
    public function update($form)
105
    public function update($record)
110
    {
106
    {
111
        $hydrator = new ObjectPropertyHydrator();
107
        $hydrator = new ObjectPropertyHydrator();
112
        $values = $hydrator->extract($form);
108
        $values = $hydrator->extract($record);
Línea 113... Línea 109...
113
        $values = $this->removeEmpty($values);
109
        $values = $this->removeEmpty($values);
114
        
110
        
115
        $update = $this->sql->update(self::_TABLE);
111
        $update = $this->sql->update(self::_TABLE);
Línea 116... Línea 112...
116
        $update->set($values);
112
        $update->set($values);
117
        $update->where->equalTo('id', $form->id);
113
        $update->where->equalTo('id', $record->id);
Línea 118... Línea 114...
118
        
114
        
119
        return $this->executeUpdate($update); 
115
        return $this->executeUpdate($update); 
120
    }
116
    }
121
    
117
    
122
    /**
118
    /**
123
     *
119
     *
124
     * @param int $form_id
120
     * @param int  $survey_id
125
     * @return boolean
121
     * @return boolean
126
     */
122
     */
Línea 127... Línea 123...
127
    public function deleteBySurevy($survey_id)
123
    public function deleteBySurveyId($survey_id)