class Model_Post extends \ORM\Model { protected static $_properties = array('id','date','title','post','draft','open'); protected static $_table_name = 'post'; protected static $_has_many = array('comments'); }
class Model_Comment extends \Orm\Model { protected static $_properties = array('id', 'name', 'email', 'date', 'url', 'comment', 'ip', 'approved', 'post_id'); protected static $_table_name = 'comments'; protected static $_belongs_to = array('post'); }
$post = new Model_Post; $post = $post->find(); //should get the 1st one and actually it does $post->comments; //it's null!!! instead of having 2 comments
It looks like you're new here. If you want to get involved, click one of these buttons!