doctrine
Rozdíly
Zde můžete vidět rozdíly mezi vybranou verzí a aktuální verzí dané stránky.
Obě strany předchozí revizePředchozí verzeNásledující verze | Předchozí verzePoslední revizeObě strany příští revize | ||
doctrine [2013/10/03 22:55] – [MySQL DB] blazek | doctrine [2013/10/03 23:48] – [Entity] blazek | ||
---|---|---|---|
Řádek 71: | Řádek 71: | ||
**Doc:** http:// | **Doc:** http:// | ||
+ | |||
+ | ===== MySQL DB ===== | ||
+ | |||
+ | Vytvoření MySQL databáze a nastavení oprávnění. | ||
+ | |||
+ | < | ||
+ | shell# mysql -p -u root | ||
+ | mysql> CREATE DATABASE doctrinedemo DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci; | ||
+ | mysql> GRANT ALL PRIVILEGES ON doctrinedemo.* TO doctrinedemo@localhost IDENTIFIED BY ' | ||
+ | mysql> FLUSH PRIVILEGES; | ||
+ | mysql> QUIT; | ||
+ | </ | ||
===== Příprava a konfigurace ===== | ===== Příprava a konfigurace ===== | ||
Řádek 106: | Řádek 118: | ||
===== Entity ===== | ===== Entity ===== | ||
+ | |||
+ | <file php entities/ | ||
+ | <?php | ||
+ | |||
+ | /** | ||
+ | * Description of User | ||
+ | * | ||
+ | * @author blazek | ||
+ | * @Entity @Table(name=" | ||
+ | */ | ||
+ | class User { | ||
+ | |||
+ | /** | ||
+ | * @Id @Column(type=" | ||
+ | * @GeneratedValue | ||
+ | */ | ||
+ | private $id; | ||
+ | |||
+ | /** @Column(type=" | ||
+ | private $firstname; | ||
+ | |||
+ | /** @Column(type=" | ||
+ | private $lastname; | ||
+ | |||
+ | /** @Column(type=" | ||
+ | private $login; | ||
+ | |||
+ | /** @Column(type=" | ||
+ | private $password; | ||
+ | |||
+ | /** @Column(type=" | ||
+ | private $description; | ||
+ | |||
+ | /** | ||
+ | * @Column(type=" | ||
+ | * @GeneratedValue | ||
+ | */ | ||
+ | private $insertDate; | ||
+ | |||
+ | function __construct() { | ||
+ | | ||
+ | } | ||
+ | |||
+ | public function getId() { | ||
+ | return $this-> | ||
+ | } | ||
+ | |||
+ | public function setId($id) { | ||
+ | $this-> | ||
+ | } | ||
+ | |||
+ | public function getFirstname() { | ||
+ | return $this-> | ||
+ | } | ||
+ | |||
+ | public function setFirstname($firstname) { | ||
+ | $this-> | ||
+ | } | ||
+ | |||
+ | public function getLastname() { | ||
+ | return $this-> | ||
+ | } | ||
+ | |||
+ | public function setLastname($lastname) { | ||
+ | $this-> | ||
+ | } | ||
+ | |||
+ | public function getLogin() { | ||
+ | return $this-> | ||
+ | } | ||
+ | |||
+ | public function setLogin($login) { | ||
+ | $this-> | ||
+ | } | ||
+ | |||
+ | public function getPassword() { | ||
+ | return $this-> | ||
+ | } | ||
+ | |||
+ | public function setPassword($password) { | ||
+ | $this-> | ||
+ | } | ||
+ | |||
+ | public function getDescription() { | ||
+ | return $this-> | ||
+ | } | ||
+ | |||
+ | public function setDescription($description) { | ||
+ | $this-> | ||
+ | } | ||
+ | |||
+ | public function getInsertDate() { | ||
+ | return $this-> | ||
+ | } | ||
+ | |||
+ | public function setInsertDate($insertDate) { | ||
+ | $this-> | ||
+ | } | ||
+ | |||
+ | } | ||
+ | ?> | ||
+ | </ | ||
<file sql create.sql> | <file sql create.sql> |
doctrine.txt · Poslední úprava: 2023/12/26 19:13 autor: 127.0.0.1