コード例 #1
0
 function __construct(Venue $venue)
 {
     $this->id = $venue->getId();
     $this->title = $venue->getTitle();
     $this->address = $venue->getAddress();
     $this->description = $venue->getDescription();
 }
コード例 #2
0
 public function __construct(Venue $model)
 {
     $this->id = $model->getId();
     $this->title = $model->getTitle();
     $this->address = $model->getAddress();
 }
コード例 #3
0
 private static function insert(Venue $model)
 {
     $db = DatabaseData::getInstance(\RedDevil\Config\DatabaseConfig::DB_INSTANCE);
     $query = "INSERT INTO venues (Title,Description,Address,OwnerId) VALUES (:Title, :Description, :Address, :OwnerId);";
     $result = $db->prepare($query);
     $result->execute([':Title' => $model->getTitle(), ':Description' => $model->getDescription(), ':Address' => $model->getAddress(), ':OwnerId' => $model->getOwnerId()]);
     $model->setId($db->lastInsertId());
 }