You've seen Kris' open source libraries, but how does he tackle coding out an application? Walk through green fields with a Symfony expert as he takes his latest “next big thing” idea from the first line of code to a functional prototype. Learn design patterns and principles to guide your way in organizing your own code and take home some practical examples to kickstart your next project.
71. public function __clone()
{
$this->id = (string) new MongoId();
$this->createdAt = new DateTime();
$this->widgets = new ArrayCollection(
$this->widgets->toArray()
);
}
72. public function __construct()
{
$this->id = (string) new MongoId();
$this->createdAt = new DateTime();
$this->widgets = new ArrayCollection();
}
public function __clone()
{
$this->id = (string) new MongoId();
$this->createdAt = new DateTime();
$this->widgets = new ArrayCollection(
$this->widgets->toArray()
);
}