src/Kunstmaan/DashboardBundle/Repository/AnalyticsSegmentRepository.php
public function deleteSegment($id)
    {
        $em = $this->getEntityManager();
        $qb = $em->createQueryBuilder();
        $qb->select('s')
            ->from('KunstmaanDashboardBundle:AnalyticsSegment', 's')
            ->where('s.id = :id')
            ->setParameter('id', $id);

        $results = $qb->getQuery()->getResult();
        if ($results) {
            $em->remove($results[0]);
            $em->flush();
        }
    }
public function deleteSegment($id)
    {
        $em = $this->getEntityManager();
        $qb = $em->createQueryBuilder();
        $qb->select('s')
            ->from('KunstmaanDashboardBundle:AnalyticsSegment', 's')
            ->where('s.id = :id')
            ->setParameter('id', $id);

        $results = $qb->getQuery()->getResult();
        if ($results) {
            $em->remove($results[0]);
            $em->flush();
        }
    }
public function deleteSegment ( $ id ) { $ em = $ this -> getEntityManager ( ) ; $ qb = $ em -> createQueryBuilder ( ) ; $ qb -> select ( 's' ) -> from ( 'KunstmaanDashboardBundle:AnalyticsSegment' , 's' ) -> where ( 's.id = :id' ) -> setParameter ( 'id' , $ id ) ; $ results = $ qb -> getQuery ( ) -> getResult ( ) ; if ( $ results ) { $ em -> remove ( $ results [ 0 ] ) ; $ em -> flush ( ) ; } }
Get a segment

@param int $id

@return AnalyticsOverview|bool
Get a segment