public function getData($options) { $offer = parent::getData($options); $offer->processStateOffer = CI_ProcessState::getData($options->processStateOffer); $offer->type = CI_OfferType::getData($options->type); $offer->quantityUsersToPaused = $options->quantityUsersToPaused; if (isset($options->id)) { $offer->favorites = CI_Offer::getFavorite($options->id); } return $offer; }
public function getProcessState() { return CI_ProcessState::getData($this->processState); }
protected function getData($options) { $publication = new stdClass(); if (isset($options->id)) { $publication->id = $options->id; $publication->image = CI_Image::getData($options->image); } $publication->title = $options->title; $publication->description = $options->description; $publication->category = CI_Category::getData($options->category); $publication->subcategory = CI_Subcategory::getData($options->subcategory); $publication->object = CI_Object::getData($options->object); $publication->quantity = $options->quantity; $publication->views = $options->views; $publication->processState = CI_ProcessState::getData($options->processState); $publication->creationDate = $options->creationDate; $publication->expirationDate = $options->expirationDate; if (isset($options->isFavorite)) { $publication->isFavorite = $options->isFavorite; } if (isset($options->isOwner)) { $publication->isOwner = $options->isOwner; } if (isset($options->userId)) { $publication->userId = $options->userId; } return $publication; }