public function __construct(Conference $model) { $this->id = $model->getId(); $this->title = $model->getTitle(); $this->startDate = $model->getStartDate(); $this->endDate = $model->getEndDate(); }
function __construct(Conference $conference) { $this->id = $conference->getId(); $this->title = $conference->getTitle(); $this->startDate = $conference->getStartDate(); $this->endDate = $conference->getEndDate(); $this->venueId = $conference->getVenue_Id(); $this->ownerId = $conference->getOwnerId(); }
private static function insert(Conference $model) { $db = DatabaseData::getInstance(\RedDevil\Config\DatabaseConfig::DB_INSTANCE); $query = "INSERT INTO conferences (Title,StartDate,EndDate,OwnerId,Venue_Id) VALUES (:Title, :StartDate, :EndDate, :OwnerId, :Venue_Id);"; $result = $db->prepare($query); $result->execute([':Title' => $model->getTitle(), ':StartDate' => $model->getStartDate(), ':EndDate' => $model->getEndDate(), ':OwnerId' => $model->getOwnerId(), ':Venue_Id' => $model->getVenue_Id()]); $model->setId($db->lastInsertId()); }