public function testThroughIsArray()
 {
     $annotation = new SecuredCondition(array('through' => 'something', 'enabled' => false, 'roles' => array('ROLE_ONE')));
     $this->assertTrue(is_array($annotation->getThrough()));
     $this->assertEquals(array('something'), $annotation->getThrough());
 }
 /**
  * @param SecuredCondition $cond
  * @param $alias
  * @param array $aliases
  */
 protected function handleThrough(SecuredCondition $cond, $alias, array &$aliases)
 {
     $joins = $this->queryBuilder->getDQLPart('join');
     foreach ($cond->getThrough() as $association) {
         $found = false;
         if (isset($joins[$alias])) {
             $found = $this->findJoin($joins, $alias, $association, $aliases);
         }
         if (!$found) {
             $newalias = strtolower(substr($association, 0, 3)) . self::$aliasCount++;
             $this->queryBuilder->leftJoin(end($aliases) . '.' . $association, $newalias);
             $aliases[] = $newalias;
         }
     }
 }