Entity:
Código PHP:
Ver original<?php
namespace ABC\IsystemBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* AbcRelationship
*
* @ORM\Table(name="abc_relationship")
* @ORM\Entity
*/
class AbcRelationship
{
/**
* @var integer
*
* @ORM\Column(name="id", type="integer", nullable=false)
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
*/
private $id;
/**
* @var string
*
* @ORM\Column(name="relationship", type="string", length=80, nullable=false)
*/
private $relationship;
/**
* @var \DateTime
*
* @ORM\Column(name="created_date", type="datetime", nullable=false)
*/
private $createdDate;
/**
* @var string
*
* @ORM\Column(name="relationship_en", type="string", length=80, nullable=false)
*/
private $relationshipEn;
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* Set relationship
*
* @param string $relationship
* @return AbcRelationship
*/
public function setRelationship($relationship)
{
$this->relationship = $relationship;
return $this;
}
/**
* Get relationship
*
* @return string
*/
public function getRelationship()
{
return $this->relationship;
}
/**
* Set createdDate
*
* @param \DateTime $createdDate
* @return AbcRelationship
*/
public function setCreatedDate($createdDate)
{
$this->createdDate = $createdDate;
return $this;
}
/**
* Get createdDate
*
* @return \DateTime
*/
public function getCreatedDate()
{
return $this->createdDate;
}
/**
* Set relationshipEn
*
* @param string $relationshipEn
* @return AbcRelationship
*/
public function setRelationshipEn($relationshipEn)
{
$this->relationshipEn = $relationshipEn;
return $this;
}
/**
* Get relationshipEn
*
* @return string
*/
public function getRelationshipEn()
{
return $this->relationshipEn;
}
}
Consulto el objeto de la siguiente manera:
Código PHP:
Ver original$relationship = $this->emMy->getRepository('ABCIsystemBundle:AbcRelationship')->findOneBy(array('relationshipEn'=>'Mother'));
Al realizar un
le aparece lo siguiente:
Código PHP:
Ver originalobject(Proxies__CG__ABC\IsystemBundle\Entity\AbcRelationship)
lazyPropertiesDefaults
array (0)__cloner__ object (Closure)
__initializer__ object (Closure)
__isInitialized__ bool true
Cuando en realidad deberia poder acceder a los atributos que tiene el objeto.