Exemple #1
0
 /**
  * Créé un tableau associatif à partir de l'objet Book
  * @param \Sb\Db\Model\Book $book
  * @param array $properties
  */
 public static function reverseMap(\Sb\Db\Model\Model $book, array &$properties)
 {
     $properties['author'] = $book->getAuthor();
     $properties['description'] = $book->getDescription();
     $properties['isbn10'] = $book->getISBN10();
     $properties['isbn13'] = $book->getISBN13();
     $properties['asin'] = $book->getASIN();
     $properties['id'] = $book->getId();
     $properties['image_binary'] = $book->getImageBinary();
     $properties['image_url'] = $book->getImageUrl();
     $properties['small_image_url'] = $book->getSmallImageUrl();
     $properties['large_image_url'] = $book->getLargeImageUrl();
     $properties['publisher'] = $book->getPublisher();
     $properties['publisher_id'] = $book->getPublisherId();
     $properties['title'] = $book->getTitle();
     if ($book->getCreationDate()) {
         $properties['creation_date'] = \Sb\Helpers\DateHelper::getDateForDB($book->getCreationDate());
     }
     if ($book->getLastModificationDate()) {
         $properties['last_modification_date'] = \Sb\Helpers\DateHelper::getDateForDB($book->getLastModificationDate());
     }
     if ($book->getPublishingDate()) {
         $properties['publishing_date'] = \Sb\Helpers\DateHelper::getDateForDB($book->getPublishingDate());
     }
     $properties['amazon_url'] = $book->getAmazonUrl();
 }
Exemple #2
0
 private function getId(Model $model)
 {
     return $model->getId();
 }