All pastes #936657 Raw Edit

Untitled

public text v1 · immutable
·published 2008-03-10 15:41 UTC
rendered paste body
class Page_Model extends ORM {

	protected $has_many = array('page_properties');
	
	protected $properties = array();
	
	public function __construct($id = FALSE)
	{
		parent::__construct($id);

		if ($this->object->id != 0)
		{
			// Preload the properties
			foreach($this->find_related_page_properties() as $property)
			{
				$this->properties[$property->name] = $property->value;
			}
		}
	}
	
} // End Page_Model

class Page_Property_Model extends ORM {

	protected $belongs_to = array('page');

}