/** * Return array or property => value pairs that describes this object * * $user is an instance of user who requested description - it's used to get * only the data this user can see * * @param IUser $user * @param boolean $detailed * @param boolean $for_interface * @return array */ function describe(IUser $user, $detailed = false, $for_interface = false) { $mil_t = new Milestone($this->getId()); $result = $mil_t->describe($user, $detailed, $for_interface); // In this exact order, it's important! $result = array_merge(parent::describe($user, $detailed, $for_interface), $result); $result['id'] = $this->getId(); if ($detailed) { $result['custom_percent_complete'] = $this->getPercentsDone(false); $result['remaining_time'] = $this->getRemainingTime(); $result['summed_time'] = $this->tracking()->sumTime($user); } return $result; }