hi I am creating a custom entity class without using command prompt.
so that I have created one table name " profile "
with the following fields.
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',
now what I have do is created one entity class named "Profile.php"
<?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->name;
}
public function setName($name)
{
$this->name = $name;
}
public function getLastName()
{
return $this->lastname;
}
public function setLastName($lastname)
{
$this->lastname = $lastname;
}
public function getEmail()
{
return $this->email;
}
public function setEmail($email)
{
$this->email = $email;
}
public function getImage()
{
return $this->image;
}
public function setImage($image)
{
$this->image = $image;
}
public function getGender()
{
return $this->gender;
}
public function setGender($gender)
{
$this->gender = $gender;
}
public function getCountry()
{
return $this->country;
}
public function setCountry($country)
{
$this->country = $country;
}
public function getState()
{
return $this->state;
}
public function setState($state)
{
$this->state = $state;
}
public function getCity()
{
return $this->city;
}
public function setCity($city)
{
$this->city = $city;
}
//public function
}
?>
after that I have created one doctrine mapping file "Profile.orm.yml".
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: { }
now the problem is when I am calling the profile page the bellow error is showed?
Class "Blogger\BlogBundle\Entity\Profile" is not a valid entity or mapped super class.
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.
but I want to customlly created the file so pls help me out. thanks,