Closed inghamn closed 10 years ago
Does it make sense for ActiveRecord class to assume you must want a model from Application\Models?
I'm not so sure. I'm thinking it would be better for models to include the full namespace for the class the model would like. This is because I can see, as a developer, wanting to customize the namespace of my application. "Application" is just a stub. I would want to change it to match my project name.
So, maybe models should just include the namespace...like so....
<?php
namespace Application\Models;
use Blossom\Classes\ActiveRecord;
class Client extends ActiveRecord {
protected $person;
public function setPerson(Person $o) {
parent::setForeignKeyObject(__namespace__.'\Person', 'person_id', $o);
}
}
the getDate and getForeignKey functions in ActiveRecord are not working with namespaces correctly.