Changeset 5081
- Timestamp:
- 10/13/08 21:39:16 (9 months ago)
- Location:
- branches
- Files:
-
- 2 modified
-
1.0/lib/Doctrine/Table.php (modified) (1 diff)
-
1.1/lib/Doctrine/Table.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/1.0/lib/Doctrine/Table.php
r4957 r5081 1346 1346 protected function findOneBy($fieldName, $value, $hydrationMode = null) 1347 1347 { 1348 $results = $this->createQuery('dctrn_find') 1349 ->where('dctrn_find.' . $fieldName . ' = ?',array($value)) 1350 ->limit(1) 1351 ->execute(array(), $hydrationMode); 1352 1353 if (is_array($results) && isset($results[0])) { 1354 return $results[0]; 1355 } else if ($results instanceof Doctrine_Collection && $results->count() > 0) { 1356 return $results->getFirst(); 1357 } else { 1358 return false; 1359 } 1348 return $this->createQuery('dctrn_find') 1349 ->where('dctrn_find.' . $fieldName . ' = ?', array($value)) 1350 ->limit(1) 1351 ->fetchOne(array(), $hydrationMode); 1360 1352 } 1361 1353 -
branches/1.1/lib/Doctrine/Table.php
r5033 r5081 1399 1399 protected function findOneBy($fieldName, $value, $hydrationMode = null) 1400 1400 { 1401 $results = $this->createQuery('dctrn_find') 1402 ->where('dctrn_find.' . $fieldName . ' = ?',array($value)) 1403 ->limit(1) 1404 ->execute(array(), $hydrationMode); 1405 1406 if (is_array($results) && isset($results[0])) { 1407 return $results[0]; 1408 } else if ($results instanceof Doctrine_Collection && $results->count() > 0) { 1409 return $results->getFirst(); 1410 } else { 1411 return false; 1412 } 1401 return $this->createQuery('dctrn_find') 1402 ->where('dctrn_find.' . $fieldName . ' = ?', array($value)) 1403 ->limit(1) 1404 ->fetchOne(array(), $hydrationMode); 1413 1405 } 1414 1406