| | 1318 | } |
| | 1319 | |
| | 1320 | /** |
| | 1321 | * findBy |
| | 1322 | * |
| | 1323 | * @param string $column |
| | 1324 | * @param string $value |
| | 1325 | * @param string $hydrationMode |
| | 1326 | * @return void |
| | 1327 | */ |
| | 1328 | protected function findBy($fieldName, $value, $hydrationMode = null) |
| | 1329 | { |
| | 1330 | return $this->createQuery('dctrn_find') |
| | 1331 | ->where('dctrn_find.' . $fieldName . ' = ?', array($value)) |
| | 1332 | ->execute(array(), $hydrationMode); |
| | 1333 | } |
| | 1334 | |
| | 1335 | /** |
| | 1336 | * findOneBy |
| | 1337 | * |
| | 1338 | * @param string $column |
| | 1339 | * @param string $value |
| | 1340 | * @param string $hydrationMode |
| | 1341 | * @return void |
| | 1342 | */ |
| | 1343 | protected function findOneBy($fieldName, $value, $hydrationMode = null) |
| | 1344 | { |
| | 1345 | $results = $this->createQuery('dctrn_find') |
| | 1346 | ->where('dctrn_find.' . $fieldName . ' = ?',array($value)) |
| | 1347 | ->limit(1) |
| | 1348 | ->execute(array(), $hydrationMode); |
| | 1349 | |
| | 1350 | if (is_array($results) && isset($results[0])) { |
| | 1351 | return $results[0]; |
| | 1352 | } else if ($results instanceof Doctrine_Collection && $results->count() > 0) { |
| | 1353 | return $results->getFirst(); |
| | 1354 | } else { |
| | 1355 | return false; |
| | 1356 | } |
| 2167 | | * findBy |
| 2168 | | * |
| 2169 | | * @param string $column |
| 2170 | | * @param string $value |
| 2171 | | * @param string $hydrationMode |
| 2172 | | * @return void |
| 2173 | | */ |
| 2174 | | protected function findBy($fieldName, $value, $hydrationMode = null) |
| 2175 | | { |
| 2176 | | return $this->createQuery()->where($fieldName . ' = ?', array($value))->execute(array(), $hydrationMode); |
| 2177 | | } |
| 2178 | | |
| 2179 | | /** |
| 2180 | | * findOneBy |
| 2181 | | * |
| 2182 | | * @param string $column |
| 2183 | | * @param string $value |
| 2184 | | * @param string $hydrationMode |
| 2185 | | * @return void |
| 2186 | | */ |
| 2187 | | protected function findOneBy($fieldName, $value, $hydrationMode = null) |
| 2188 | | { |
| 2189 | | $results = $this->createQuery() |
| 2190 | | ->where($fieldName . ' = ?',array($value)) |
| 2191 | | ->limit(1) |
| 2192 | | ->execute(array(), $hydrationMode); |
| 2193 | | |
| 2194 | | if (is_array($results) && isset($results[0])) { |
| 2195 | | return $results[0]; |
| 2196 | | } else if ($results instanceof Doctrine_Collection && $results->count() > 0) { |
| 2197 | | return $results->getFirst(); |
| 2198 | | } else { |
| 2199 | | return false; |
| 2200 | | } |
| 2201 | | } |
| 2202 | | |
| 2203 | | /** |