I'm following this Symfony2/Doctrine guide and I've come to the part where I need to create getters/setters. but I am stuck with this part:
$ php app/console doctrine:generate:entities Acme/StoreBundle/Entity/Job
I've searched the net for possible solutions (seems to mainly revolve around using 2 asterisks for the start) but couldn't find the solution.
Some info:
- Bundle is properly loaded (via AppKernel.php) as I have a test "hello world" and that works.
- The namespace path is correct
- Job.php exists in the right folder
- I'm using postgres as my database. I'm not sure if this matters.
- I have tried with and without the use Doctrine\ORM\Mapping line in model class (see below for code)
- I don't think I'm running a accelerator at least according to get_loaded_extensions function Any ideas would be very helpful.
Thanks a lot :)
snippet of my settings.yml
doctrine:
dbal:
driver: "%database_driver%"
host: "%database_host%"
port: "%database_port%"
dbname: "%database_name%"
user: "%database_user%"
password: "%database_password%"
charset: UTF8
# if using pdo_sqlite as your database driver, add the path in parameters.yml
# e.g. database_path: "%kernel.root_dir%/data/data.db3"
# path: "%database_path%"
orm:
auto_generate_proxy_classes: "%kernel.debug%"
auto_mapping: true
Model
class
<?php
// src/MyApp/MyBundle/Model/Job.php
namespace MyApp\MyBundle\Model;
use Doctrine\ORM\Mapping as ORM;
/**
* MyApp\MyBundle\Model\Job
*
* @ORM\Entity
* @ORM\Table(name="myschema.jobs")
*/
class Job {
/**
* @ORM\Column(name="job_id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $jobid;
/**
* @ORM\Column(name="name", type="text")
*/
protected $name;
/**
* @ORM\Column(name="job_desc", type="text")
*/
protected $description;
/**
* @ORM\Column(name="personal_req", type="text")
*/
protected $requirements;
}