in what file, or where ,is the mapping of controller to model occur in
- symfony 1.4
- symfony 2
are there any yml/config files that tell the system to recognize the appropriate model?
what I mean is:
let’s say a controller looks like this:
class jobActions extends sfActions
{
public function executeIndex(sfWebRequest $request)
{
$user=new PcUser();
$user->username=$request->GetParameters(...);
}
}
and PcUser.php is an entity file that has PcUser class inside.
where is the mapping done? how does the controller jobActions know PcUser?
It’s done by symfony’s autoloader. If the script doesn’t know about class you are trying to use, then autoloader try include appropriate class based on namespace.
So, for your example:
And if you ask about ORM mapping – you can do it in several ways like appropriate yaml configuration file, or annotations inside entities.