Ejemplo n.º 1
0
 /**
  * Perform the update action on a record that's been changed.
  *
  * @param array $record the record that has been changed
  * @param int $index the index of the item in the set
  *
  * @return bool true if the update was performed successfuly, false if there were issues
  */
 protected function _updateRecord($record, $index)
 {
     // If the parent class didn't manage to update the record
     // then don't attempt to perform this update
     if (!parent::_updateRecord($record, $index)) {
         return false;
     }
     if ($this->hasPositionAttribute()) {
         $record[$this->getPositionAttribute()] = $index + 1;
         if (!$this->getLink()->updateDb($record, true, '', array($this->getPositionAttribute()))) {
             return false;
         }
     }
     return true;
 }