Proyectos de Subversion LeadersLinked - Services

Rev

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

Rev 167 Rev 175
Línea 61... Línea 61...
61
    }
61
    }
Línea 62... Línea 62...
62
    
62
    
63
    /**
63
    /**
64
     *
64
     *
65
     * @param int $contact_id 
-
 
66
     * @param int $blacklist_reason_id
65
     * @param int $contact_id 
67
     * @return DiscoveryContactBlackList
66
     * @return DiscoveryContactBlackList
68
     */
67
     */
69
    public function fetchByContactIdAndBlackListReasonId($contact_id, $blacklist_reason_id)
68
    public function fetchOneByContactId($contact_id)
Línea 70... Línea 69...
70
    {
69
    {
71
        
70
        
72
        $select = $this->sql->select(self::_TABLE);
-
 
73
        $select->where->equalTo('contact_id', $contact_id);
71
        $select = $this->sql->select(self::_TABLE);
74
        $select->where->equalTo('blacklist_reason_id', $blacklist_reason_id);
-
 
75
        
72
        $select->where->equalTo('contact_id', $contact_id);
76
        
73
 
77
        $prototype = new DiscoveryContactBlackList();
74
        $prototype = new DiscoveryContactBlackList();
Línea -... Línea 75...
-
 
75
        return $this->executeFetchOneObject($select, $prototype);
-
 
76
    }
-
 
77
    
-
 
78
    /**
-
 
79
     * 
-
 
80
     * @param int $company_id
-
 
81
     * @return int[]
-
 
82
     */
-
 
83
    public function fetchAllContactIdsByCompanyId($company_id)
-
 
84
    {
-
 
85
        $select = $this->sql->select(self::_TABLE);
-
 
86
        $select->columns(['contact_id']);
-
 
87
        $select->where->equalTo('company_id', $company_id);
-
 
88
     
-
 
89
        $ids = [];
-
 
90
        $records = $this->executeFetchAllArray($select);
-
 
91
        foreach($records as $record) 
-
 
92
        {
-
 
93
            array_push($ids, $record['contact_id']);    
-
 
94
        }
-
 
95
        
-
 
96
        return $ids;
-
 
97
        
-
 
98
        
-
 
99
        
Línea 78... Línea 100...
78
        return $this->executeFetchOneObject($select, $prototype);
100
        
79
    }
101
    }
80
    
102
    
81
    
103
    
Línea 144... Línea 166...
144
        
166
        
145
        return $result;
167
        return $result;
Línea -... Línea 168...
-
 
168
    }
-
 
169
    
-
 
170
    
-
 
171
    
-
 
172
    /**
-
 
173
     *
-
 
174
     * @param DiscoveryContactBlackList $record
-
 
175
     * @return boolean
-
 
176
     */
-
 
177
    public function update($record)
-
 
178
    {
-
 
179
        $hydrator = new ObjectPropertyHydrator();
-
 
180
        $values = $hydrator->extract($record);
-
 
181
        $values = $this->removeEmpty($values);
-
 
182
        
-
 
183
        $update = $this->sql->update(self::_TABLE);
-
 
184
        $update->set($values);
-
 
185
        $update->where->equalTo('id', $record->id);
-
 
186
        
-
 
187
        return $this->executeUpdate($update);
-
 
188
        
-
 
189
 
-
 
190
    }
146
    }
191
    
147
    
192
    
148
    
193
    
149
    /**
194
    /**
150
     *
195
     *