Permalink
Browse files

Updated README

  • Loading branch information...
wjgilmore committed Jun 2, 2011
1 parent 3366a66 commit 1edf3d89bcb710013237ebfb077c431f81706c91
Showing with 146 additions and 10 deletions.
  1. +2 −9 README.markdown
  2. +144 −0 application/models/Entities/Rank.php
  3. +0 −1 tests/phpunit.xml
View
@@ -1,6 +1,6 @@
README
===========
-z2d2 is a companion project to Chapter 7 ("Integrating Doctrine 2") of the forthcoming book, [Easy PHP Websites with the Zend Framework, Second Edition](http://www.wjgilmore.com), authored by W. Jason Gilmore and published by [WJ Gilmore, LLC](http://www.wjgilmore.com). This project provides readers with a Zend Framework-driven website configured to use Doctrine 2.
+z2d2 is a companion project to Chapter 7 ("Integrating Doctrine 2") of the book, [Easy PHP Websites with the Zend Framework, Second Edition](http://www.wjgilmore.com), authored by W. Jason Gilmore and published by [WJ Gilmore, LLC](http://www.wjgilmore.com). This project provides readers with a Zend Framework-driven website configured to use Doctrine 2.
Chapter 7 introduces key Doctrine 2 features based on code found throughout this project. You'll learn:
@@ -62,14 +62,7 @@ A PDF version of Chapter 7, "Integrating Doctrine 2", is available for download
BUY THE BOOK
===========
-"Easy PHP Websites with the Zend Framework, Second Edition" is slated to be released in e-book format in late February, 2011. This book includes several sample projects, including all source code for GameNomad, a sample social networking website for video gamers which forms the basis for many of the book's examples.
-
-To celebrate the book's pending release, interested readers can preorder the book for $20. This special price will be good until the day the book publishes, at which time the price will increase to $30. Once published, all readers will be
-notified via e-mail of the book's availability and will be able to download the book in PDF and ePub format, along with all of the sample code.
-
-Preorder the book now at [http://www.wjgilmore.com/](http://www.wjgilmore.com/).
-
-Once an initial round of bugs have been reported and fixed, a print version will be released in late spring of 2011.
+"Easy PHP Websites with the Zend Framework, Second Edition" is available as a DRM-free PDF via WJGilmore.com, in Kindle format via Amazon.com, and in Nook format via BN.com. This book includes several sample projects, including all source code for GameNomad, a sample social networking website for video gamers which forms the basis for many of the book's examples.
ABOUT THE AUTHOR
===========
@@ -0,0 +1,144 @@
+<?php
+
+namespace Entities;
+use Doctrine\Common\Collections\ArrayCollection;
+
+/**
+ * @Entity (repositoryClass="Repositories\Account")
+ * @Table(name="accounts")
+ * @HasLifecycleCallbacks
+ */
+class Account
+{
+ /**
+ * @Id @Column(type="integer")
+ * @GeneratedValue(strategy="AUTO")
+ */
+ private $id;
+
+ /** @Column(type="string", length=255) */
+ private $username;
+
+ /** @Column(type="string", length=255) */
+ private $email;
+
+ /** @Column(type="string", length=32) */
+ private $password;
+
+ /** @Column(type="string", length=10) */
+ private $zip;
+
+ /** @Column(type="datetime") */
+ private $created;
+
+ /** @Column(type="datetime") */
+ private $updated;
+
+ /**
+ * @ManyToMany(targetEntity="Game", inversedBy="accounts")
+ * @JoinTable(name="accounts_games",
+ * joinColumns={@JoinColumn(name="account_id", referencedColumnName="id")},
+ * inverseJoinColumns={@JoinColumn(name="game_id", referencedColumnName="id")}
+ * )
+ */
+
+ private $games;
+
+ public function __construct()
+ {
+
+ $this->games = new ArrayCollection();
+
+ $this->created = $this->updated = new \DateTime("now");
+ }
+
+ /**
+ * Add game to account.
+ * @param Game $game
+ */
+ public function addGame(Game $game)
+ {
+ $game->addAccount($this);
+ $this->games[] = $game;
+ }
+
+ /**
+ * Retrieve account's associated games.
+ */
+ public function getGames()
+ {
+ return $this->games;
+ }
+
+ /**
+ * @PreUpdate
+ */
+ public function updated()
+ {
+ $this->updated = new \DateTime("now");
+ }
+
+ /**
+ * Retrieve account id
+ */
+ public function getId()
+ {
+ return $this->id;
+ }
+
+ public function getUsername()
+ {
+ return $this->username;
+ }
+
+ public function setUsername($username)
+ {
+ $this->username = $username;
+ }
+
+ public function getEmail()
+ {
+ return $this->email;
+ }
+
+ public function setEmail($email)
+ {
+ $this->email = $email;
+ }
+
+ public function getPassword()
+ {
+ return $this->password;
+ }
+
+ public function setPassword($password)
+ {
+ $this->password = md5($password);
+ }
+
+ public function getZip()
+ {
+ return $this->zip;
+ }
+
+ public function setZip($zip)
+ {
+ $this->zip = $zip;
+ }
+
+ public function getCreated()
+ {
+ return $this->created;
+ }
+
+ public function setCreated($created)
+ {
+ $this->created = $created;
+ }
+
+ public function getUpdated()
+ {
+ return $this->updated;
+ }
+
+}
View
@@ -9,7 +9,6 @@
<exclude>
<file>../application/bootstrap.php</file>
<file>../application/controllers/ErrorController.php</file>
- <directory suffix=".phtml">../application/</directory>
<directory>../application/scripts</directory>
</exclude>
</whitelist>

0 comments on commit 1edf3d8

Please sign in to comment.