I am having trouble accessing a custom class I created in a new folder in a bundle.
I have a bundle called: MemberBundle - located at src/My/Bundle/MemberBundle
I created a directory called Models located at src/My/Bundle/MemberBundle/Models
In that directory I have a file called MemberModel.php with the following code:
<?php
namespace My\MemberBundle\Models;
class MemberModel {
public function getActiveCampaignId($zone) {
### Custom Mysql Query
...
}
}
When I try and access that class from my controller like this:
$MemberModel = new My\MemberBundle\Models\MemberModel();
$data = $MemberModel->getActiveCampaignId("1");
print_r($data);
I get an error:
Fatal error: Class 'My\MemberBundle\Models\MemberModel' not found in ...
Could anyone please point me in the right direction?
Bundledirectory. Is there a reason for that?Bundledirectory and putMemberBundleas a child ofMyBundlein the middle or not. We had a briefing by some people from Sensio and they used theBundlein the middle every time. In most bundles though it isn't used that often. Edit Actually theSymfonyBundleitself uses theBundlein the middle.