예제 #1
0
 public static function fromDB($data)
 {
     if (!isset($data['entityId'])) {
         throw new Exception('Cannot create an FeedItem without the required entityId property');
     }
     if (!isset($data['feed'])) {
         throw new Exception('Cannot create an FeedItem without the required feed property');
     }
     if (!isset($data['metadata'])) {
         throw new Exception('Cannot create an FeedItem without the required metadata property');
     }
     if (!isset($data['disco'])) {
         throw new Exception('Cannot create an FeedItem without the required disco property');
     }
     $new = new FeedItem($data['entityId'], $data['feed'], $data['metadata']);
     $new->setDisco($data['disco']);
     $new->stored = true;
     return $new;
 }