I have the following code in my controller:
$shares = $this
->getDoctrine()
->getRepository('AppBundle:Shares')
->findBy(
$where,
$orderBy,
$paginator->getPerPage(),
$paginator->getCursor()
)
;
Notice that I have the where
variable for the findby
method as a parameter.
The variable where
is an array:
$where['hashtags'] = "teste";
The problem is that in the% co_of entity, the Shares
field is an array:
/**
* @ORM\Column(type="array")
*/
protected $hashtags;
The database is saved as follows:
a:2:{i:0;s:5:"teste";i:1;s:9:"bubbletea";}
How do I search all the records that have in the hashtags
field the "test" tag using the hashtags
function?