Beispiel #1
0
 /**
  * Initializes this Entry from an associative array
  *
  * @param array $o
  */
 public function initFromArray($o)
 {
     $this->authors = array();
     if (isset($o['authors'])) {
         foreach ($o['authors'] as $i => $x) {
             $this->authors[$i] = new Person($x);
         }
         unset($o['authors']);
     }
     $this->categories = array();
     if (isset($o['categories'])) {
         foreach ($o['categories'] as $i => $x) {
             $this->categories[$i] = new Category($x);
         }
         unset($o['categories']);
     }
     if (isset($o['confidence'])) {
         $this->confidence = $o["confidence"];
         unset($o['confidence']);
     }
     if (isset($o['content'])) {
         $this->content = new Content($o["content"]);
         unset($o['content']);
     }
     $this->contributors = array();
     if (isset($o['contributors'])) {
         foreach ($o['contributors'] as $i => $x) {
             $this->contributors[$i] = new Person($x);
         }
         unset($o['contributors']);
     }
     if (isset($o['id'])) {
         $this->id = $o["id"];
         unset($o['id']);
     }
     $this->links = array();
     if (isset($o['links'])) {
         foreach ($o['links'] as $i => $x) {
             if (!array_key_exists("rel", $x)) {
                 $x["rel"] = $i;
             }
             $this->links[$i] = new Link($x);
         }
         unset($o['links']);
     }
     if (isset($o['published'])) {
         $this->published = $o["published"];
         unset($o['published']);
     }
     if (isset($o['rights'])) {
         $this->rights = $o["rights"];
         unset($o['rights']);
     }
     if (isset($o['score'])) {
         $this->score = $o["score"];
         unset($o['score']);
     }
     if (isset($o['title'])) {
         $this->title = $o["title"];
         unset($o['title']);
     }
     if (isset($o['updated'])) {
         $this->updated = $o["updated"];
         unset($o['updated']);
     }
     parent::initFromArray($o);
 }
Beispiel #2
0
 /**
  * Initializes this Feed from an associative array
  *
  * @param array $o
  */
 public function initFromArray($o)
 {
     $this->authors = array();
     if (isset($o['authors'])) {
         foreach ($o['authors'] as $i => $x) {
             $this->authors[$i] = new Person($x);
         }
         unset($o['authors']);
     }
     $this->contributors = array();
     if (isset($o['contributors'])) {
         foreach ($o['contributors'] as $i => $x) {
             $this->contributors[$i] = new Person($x);
         }
         unset($o['contributors']);
     }
     if (isset($o['generator'])) {
         $this->generator = new Generator($o["generator"]);
         unset($o['generator']);
     }
     if (isset($o['icon'])) {
         $this->icon = $o["icon"];
         unset($o['icon']);
     }
     if (isset($o['id'])) {
         $this->id = $o["id"];
         unset($o['id']);
     }
     if (isset($o['results'])) {
         $this->results = $o["results"];
         unset($o['results']);
     }
     if (isset($o['index'])) {
         $this->index = $o["index"];
         unset($o['index']);
     }
     $this->links = array();
     if (isset($o['links'])) {
         foreach ($o['links'] as $i => $x) {
             if (!array_key_exists("rel", $x)) {
                 $x["rel"] = $i;
             }
             $this->links[$i] = new Link($x);
         }
         unset($o['links']);
     }
     if (isset($o['logo'])) {
         $this->logo = $o["logo"];
         unset($o['logo']);
     }
     if (isset($o['rights'])) {
         $this->rights = $o["rights"];
         unset($o['rights']);
     }
     if (isset($o['subtitle'])) {
         $this->subtitle = $o["subtitle"];
         unset($o['subtitle']);
     }
     if (isset($o['title'])) {
         $this->title = $o["title"];
         unset($o['title']);
     }
     if (isset($o['updated'])) {
         $this->updated = $o["updated"];
         unset($o['updated']);
     }
     $this->entries = array();
     if (isset($o['entries'])) {
         foreach ($o['entries'] as $i => $x) {
             $this->entries[$i] = new Entry($x);
         }
         unset($o['entries']);
     }
     $this->facets = array();
     if (isset($o['facets'])) {
         foreach ($o['facets'] as $i => $x) {
             $this->facets[$i] = new Field($x);
         }
         unset($o['facets']);
     }
     parent::initFromArray($o);
 }