Ejemplo n.º 1
0
 /**
  * @param Speaker $speaker
  */
 public function save(Speaker $speaker)
 {
     $sql = "INSERT INTO {$this->table} (first_name, last_name, email, twitter) VALUES (" . ":first_name, :last_name, :email, :twitter" . ")";
     $stmt = $this->db->prepare($sql);
     $stmt->bindParam(":first_name", $speaker->getFirstName(), \PDO::PARAM_STR);
     $stmt->bindParam(":last_name", $speaker->getLastName(), \PDO::PARAM_STR);
     $stmt->bindParam(":email", $speaker->getEmail(), \PDO::PARAM_STR);
     $stmt->bindParam(":twitter", $speaker->getTwitter(), \PDO::PARAM_STR);
     $stmt->execute();
     $speaker->id = $this->db->lastInsertId();
 }
Ejemplo n.º 2
0
 public function testCanGetEmail()
 {
     $this->assertSame('*****@*****.**', $this->speaker->getEmail()->__toString());
 }