class User extends Eloquent { public function __construct() { $this->table = 'user_details'; } }
/** @Entity */ class User { /** @Id @GeneratedValue(strategy="AUTO") @Column(type="integer") */ private $id; /** @Column(type="string", name="full_name") */ private $fullName; public function __construct($fullName) { $this->fullName = $fullName; } }
class Book extends BaseBook { public function __construct($title) { parent::__construct(); $this->setTitle($title); } }In this example, the __construct method takes an argument $title and sets it to the title property of the Book model. The package library for these examples is either Laravel, Doctrine, or Propel ORM, depending on which library the example is demonstrating.