Beispiel #1
0
 public function changeTaskName($newTaskName)
 {
     if ($this->taskName == $newTaskName) {
         return true;
     }
     $success = $this->update(array('TASK_NAME' => $newTaskName));
     if (!$success) {
         return false;
     }
     if ($this->isToDepartmentParent()) {
         SharingTable::updateBatch(array('TASK_NAME' => $newTaskName), array('PARENT_ID' => $this->id));
         if ($this->isLoadedChildren()) {
             foreach ($this->getChildren() as $child) {
                 $child->setAttributes(array('TASK_NAME' => $newTaskName));
             }
             unset($child);
         }
     }
     return true;
 }