/** * Method for handling annotation notifications * * @param Annotation $data * @return null */ public function onDocAnnotated($data) { $notices = Notification::getActiveNotifications(MadisonEvent::DOC_ANNOTATED); $notifications = $this->processNotices($notices, MadisonEvent::DOC_ANNOTATED); $doc = Doc::find($data->doc_id); //Load annotation link $data->link = $data->getLink(); $this->doNotificationActions($notifications, array('data' => array('annotation' => $data->toArray(), 'doc' => $doc->toArray()), 'subject' => 'A new annotation on a document!', 'from_email_address' => static::FROM_EMAIL_ADDRESS, 'from_email_name' => static::FROM_EMAIL_NAME)); }
/** * Defines how chart annotations will be displayed. * * @param Annotation $a * @return BarChart */ public function annotations(Annotation $a) { return $this->addOption($a->toArray()); }