Beispiel #1
0
 public function export(WriterResult $result)
 {
     switch ($result->getType()) {
         case WriterInterface::JSON:
         case WriterInterface::XML:
             return parent::export($result);
             break;
         case WriterInterface::ATOM:
             $entry = $result->getWriter()->createEntry();
             $entry->setTitle($this->friendName);
             $entry->setId('urn:uuid:' . $this->friendGlobalId);
             $entry->setUpdated($this->getDate());
             $entry->addAuthor($this->authorName, $this->authorProfileUrl);
             $entry->addLink($this->friendProfileUrl, 'alternate', 'text/html');
             $entry->setContent($this, 'application/xml');
             return $entry;
             break;
         default:
             throw new Exception('Writer is not supported');
             break;
     }
 }
Beispiel #2
0
 public function apply($value)
 {
     return Friend\Record::getStatus($value) === false ? false : true;
 }
Beispiel #3
0
 public function getStatus()
 {
     $status = array();
     $result = Record::getStatus();
     foreach ($result as $k => $v) {
         array_push($status, array('label' => $v, 'value' => $k));
     }
     return $status;
 }