Note that there are some explanatory texts on larger screens.

plurals
  1. POCustom entity generation error in symfony2
    primarykey
    data
    text
    <p>hi I am creating a custom entity class without using command prompt.</p> <p>so that I have created one table name " profile "</p> <p>with the following fields.</p> <pre><code>id: type = integer,Pk, name: type = string lastname: type = string, email: type = string gender: type = enum('male','female'), country: type = string state: type = string, city: type='string', </code></pre> <p>now what I have do is created one entity class named "Profile.php"</p> <pre><code> &lt;?php namespace Blogger\BlogBundle\Entity; use Doctrine\ORM\Mapping as ORM; class Profile { protected $id; protected $name; protected $lastname; protected $email; protected $image; protected $gender; protected $city; protected $state; protected $country; public function getName() { return $this-&gt;name; } public function setName($name) { $this-&gt;name = $name; } public function getLastName() { return $this-&gt;lastname; } public function setLastName($lastname) { $this-&gt;lastname = $lastname; } public function getEmail() { return $this-&gt;email; } public function setEmail($email) { $this-&gt;email = $email; } public function getImage() { return $this-&gt;image; } public function setImage($image) { $this-&gt;image = $image; } public function getGender() { return $this-&gt;gender; } public function setGender($gender) { $this-&gt;gender = $gender; } public function getCountry() { return $this-&gt;country; } public function setCountry($country) { $this-&gt;country = $country; } public function getState() { return $this-&gt;state; } public function setState($state) { $this-&gt;state = $state; } public function getCity() { return $this-&gt;city; } public function setCity($city) { $this-&gt;city = $city; } //public function } ?&gt; </code></pre> <p>after that I have created one doctrine mapping file "Profile.orm.yml".</p> <pre><code>Blogger\BlogBundle\Entity\Profile: type: profile table: null repositoryClass: Blogger\BlogBundle\Entity\ProfileRepository fields: id: type: integer id: true generator: strategy: AUTO name: type: string length: '255' lastname: type: string length: '255' email: type: string length: '255' gender: type: string columnDefinition: enum('male','female') image: type: string length: '255' country: type: string length: '255' state: type: string length: '255' city: type: string length: '255' lifecycleCallbacks: { } </code></pre> <p>now the problem is when I am calling the profile page the bellow error is showed?</p> <pre><code> Class "Blogger\BlogBundle\Entity\Profile" is not a valid entity or mapped super class. </code></pre> <p>so pls let me know is there any other place I have to forget to code. or the error part in current file. coz, when I m generate the entity using the command prompt the same 2 file is created and that working fine.</p> <p>but I want to customlly created the file so pls help me out. thanks,</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload