public function testGetEntityPrefix()
 {
     $column = new EntityColumn('test_name', 'testAssociationCamelCase', 'testField');
     $this->assertEquals('tacc_0', $column->getEntityPrefix());
     $column = new EntityColumn('test_name', 'test_association_snake_case', 'testField');
     $this->assertEquals('tasc_0', $column->getEntityPrefix());
     $column = new EntityColumn('test_name', 'testAaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz', 'testField');
     $this->assertEquals('tabcdefghijklmnopqrstuvwxyz_0', $column->getEntityPrefix());
     $column = new EntityColumn('test_name', 'test_aa_bb_cc_dd_ee_ff_gg_hh_ii_jj_kk_ll_mm_nn_oo_pp_qq_rr_ss_tt_uu_vv_ww_xx_yy_zz', 'testField');
     $this->assertEquals('tabcdefghijklmnopqrstuvwxyz_1', $column->getEntityPrefix());
 }
 /**
  * @param QueryBuilder $qb
  * @param EntityColumn $column
  */
 private function joinColumn(QueryBuilder $qb, EntityColumn $column)
 {
     $joins = [];
     $pos = strpos($column->getField(), '.');
     if (false !== $pos) {
         $fields = $column->getField();
         $prefix = '';
         while (false !== $pos) {
             $join = [empty($prefix) ? $this->table->getPrefix() : $prefix];
             $field = substr($fields, 0, $pos);
             $prefix .= (empty($prefix) ? '' : '_') . EntityColumn::createEntityPrefix($field);
             array_push($join, $field, $prefix);
             $joins[join('.', $join)] = $join;
             $fields = substr($fields, $pos + 1);
             $pos = strpos($fields, '.');
             if (false === $pos && 0 < strlen($fields)) {
                 $pos = strlen($fields);
             }
         }
     } else {
         $join = [$this->table->getPrefix(), $column->getField(), $column->getEntityPrefix()];
         $joins[join('.', $join)] = $join;
     }
     foreach ($joins as $key => $join) {
         if (!isset($this->joins[$key])) {
             $qb->leftJoin($join[0] . '.' . $join[1], $join[2]);
             $this->joins[$key] = $join;
         }
     }
 }