Location: PHPKode > scripts > Object dynamic generation > object-dynamic-generation/model/Movie.class.php
<?php
/*
 * This example shows that after you extends the Model
 * You just need a constructor and the rest of the Getter
 * and Setter will be generated dynamically.
 *
 * @author Roy
 */
class Movie extends Model {
	public function __construct($title = null, $price = null, $category = null) {
		if($args = func_num_args() != 3)
			throw new Exception(__CLASS__ ." Object only accepts
			[ Title_string ] [ Price_float ] [ Category_string ].", 101);
		$this->setTitle(htmlspecialchars($title));
		$this->setPrice(htmlspecialchars($price));
		$this->setCategory(htmlspecialchars($category));
	}
}
?>
Return current item: Object dynamic generation