/** * * Adds a_edited array of data to Question * * @param User $user * @param string $reason reason for editing * * @return object $this */ public function setEdited(User $user, $reason = '') { if (!empty($reason)) { $reason = \strip_tags((string) $reason); } $aEdited = $this->offsetGet('a_edited'); if (empty($aEdited) || !is_array($aEdited)) { $aEdited = array(); } $aEdited[] = array('username' => $user->getDisplayName(), 'i_uid' => $user->getUid(), 'av' => $user->getAvatarSrc(), 'reason' => $reason, 'hts' => date('F j, Y g:i a T')); parent::offsetSet('a_edited', $aEdited); return $this; }