Skip to content

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also .

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also .
...
  • 2 commits
  • 1 file changed
  • 0 commit comments
  • 2 contributors
Commits on Feb 15, 2012
@jkm9000 jkm9000 Replacing hardcoded 'position' field with $this->_options['name'] so
that refreshPosition works with other names.
2bc87f4
@bshaffer Merge pull request #19 from jkm9000/remove_hardcoded_position
Bugfix in listener refreshPosition()
b077121
Showing with 3 additions and 2 deletions.
  1. +3 −2 lib/listener/Sortable.php
View
5 lib/listener/Sortable.php
@@ -91,17 +91,18 @@ public function preDelete(Doctrine_Event $event)
*/
private function refreshPosition(Doctrine_Record $object)
{
+ $fieldName = $this->_options['name'];
$identifiers = $object->getTable()->getIdentifierColumnNames();
- $query = $object->getTable()->createQuery()->select($this->_options['name']);
+ $query = $object->getTable()->createQuery()->select($fieldName);
foreach($identifiers as $identifier)
{
$query->andWhere($identifier . ' = ?', $object->get($identifier));
}
$position = $query->fetchOne(array(), Doctrine::HYDRATE_ARRAY);
- $object->set($this->_options['name'], $position['position'], false);
+ $object->set($fieldName, $position[$fieldName], false);
}
/**

No commit comments for this range

Something went wrong with that request. Please try again.