Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 3454 Rev 4776
Línea 90... Línea 90...
90
        $select->order('name');
90
        $select->order('name');
Línea 91... Línea 91...
91
        
91
        
92
        return $this->executeFetchAllObject($select, $prototype);
92
        return $this->executeFetchAllObject($select, $prototype);
Línea 93... Línea -...
93
    }
-
 
94
 
-
 
95
     /**
-
 
96
     *
-
 
97
     * @param int $company_id
-
 
98
     * @return RecruitmentSelectionVacancy
-
 
99
     */
-
 
100
    public function fetchOneByCompanyId($company_id)
-
 
101
    {
-
 
102
        $prototype = new RecruitmentSelectionVacancy();
-
 
103
        
-
 
104
        $select = $this->sql->select(self::_TABLE);
-
 
105
        $select->where->equalTo('company_id', $company_id);
-
 
106
        $select->order('name');
-
 
107
        
-
 
108
        return $this->executeFetchOneObject($select, $prototype);
-
 
Línea 109... Línea 93...
109
    }
93
    }
110
    
94
 
111
    
95
    
112
    /**
96
    /**
113
     * 
97
     * 
114
     * @param RecruitmentSelectionVacancy $form
98
     * @param RecruitmentSelectionVacancy $record
115
     * @return boolean
99
     * @return boolean
116
     */
100
     */
117
    public function insert($form)
101
    public function insert($record)
118
    {
102
    {
Línea 119... Línea 103...
119
        $hydrator = new ObjectPropertyHydrator();
103
        $hydrator = new ObjectPropertyHydrator();
120
        $values = $hydrator->extract($form);
104
        $values = $hydrator->extract($record);
Línea 121... Línea 105...
121
        $values = $this->removeEmpty($values);
105
        $values = $this->removeEmpty($values);
122
        
106
        
123
        $insert = $this->sql->insert(self::_TABLE);
107
        $insert = $this->sql->insert(self::_TABLE);
124
        $insert->values($values);
108
        $insert->values($values);
125
        
109
        
126
        $result = $this->executeInsert($insert);
110
        $result = $this->executeInsert($insert);
Línea 127... Línea 111...
127
        if($result) {
111
        if($result) {
128
            $form->id = $this->lastInsertId;
112
            $record->id = $this->lastInsertId;
129
        }
113
        }
130
        return $result;
114
        return $result;
131
    }
115
    }
132
    
116
    
133
    /**
117
    /**
134
     *
118
     *
135
     * @param RecruitmentSelectionVacancy $form
119
     * @param RecruitmentSelectionVacancy $record
136
     * @return boolean
120
     * @return boolean
Línea 137... Línea 121...
137
     */
121
     */
138
    public function update($form)
122
    public function update($record)
139
    {
123
    {
140
        $hydrator = new ObjectPropertyHydrator();
124
        $hydrator = new ObjectPropertyHydrator();
141
        $values = $hydrator->extract($form);
125
        $values = $hydrator->extract($record);
Línea 142... Línea 126...
142
        $values = $this->removeEmpty($values);
126
        $values = $this->removeEmpty($values);
143
        
127
        
144
        $update = $this->sql->update(self::_TABLE);
128
        $update = $this->sql->update(self::_TABLE);
145
        $update->set($values);
129
        $update->set($values);
146
        $update->where->equalTo('id', $form->id);
130
        $update->where->equalTo('id', $record->id);
147
        return $this->executeUpdate($update); 
131
        return $this->executeUpdate($update); 
148
    }
132
    }
149
    
133
    
150
    /**
134
    /**
Línea 151... Línea 135...
151
     *
135
     *
152
     * @param int $form_id
136
     * @param int $id
Línea 153... Línea 137...
153
     * @return boolean
137
     * @return boolean
154
     */
138
     */
155
    public function delete($form_id)
-
 
156
    {
-
 
157
        $delete = $this->sql->delete(self::_TABLE);
-
 
158
        $delete->where->equalTo('id', $form_id);
-
 
159
        
-
 
160
        return $this->executeDelete($delete);
-
 
161
    }
-
 
162
    
139
    public function delete($id)
163
    
140
    {
164
    /**
141
        $delete = $this->sql->delete(self::_TABLE);
165
     *
142
        $delete->where->equalTo('id', $id);
166
     * @param int $company_id
143
        
167
     * @param string $search
144
        return $this->executeDelete($delete);
Línea 192... Línea 169...
192
        $paginator->setItemCountPerPage($records_per_page);
169
        $paginator->setItemCountPerPage($records_per_page);
193
        $paginator->setCurrentPageNumber($page);
170
        $paginator->setCurrentPageNumber($page);
Línea 194... Línea 171...
194
        
171
        
195
        
172
        
Línea 196... Línea 173...
196
        return $paginator;
173
        return $paginator;
197
    }
174
    }*/