public function beforeSelect(Select $event)
    {
        if ($this->isLazyLoaded()) {
            return;
        }

        $fields = $this->getFieldsPrefixed();
        $table = $this->entityDescriptor->getTableName();
        $relateTable = $this->getParentTableName();
        $pmk = $this->getParentPrimaryKey();

        $onClause = "{$table}.{$this->getForeignKey()} = ".
            "{$relateTable}.{$pmk}";

        $query = $event->getQuery();
        $query->join($relateTable, $onClause, $fields, $relateTable);
    }
public function beforeSelect(Select $event)
    {
        if ($this->isLazyLoaded()) {
            return;
        }

        $fields = $this->getFieldsPrefixed();
        $table = $this->entityDescriptor->getTableName();
        $relateTable = $this->getParentTableName();
        $pmk = $this->getParentPrimaryKey();

        $onClause = "{$table}.{$this->getForeignKey()} = ".
            "{$relateTable}.{$pmk}";

        $query = $event->getQuery();
        $query->join($relateTable, $onClause, $fields, $relateTable);
    }
public function beforeSelect ( Select $ event ) { if ( $ this -> isLazyLoaded ( ) ) { return ; } $ fields = $ this -> getFieldsPrefixed ( ) ; $ table = $ this -> entityDescriptor -> getTableName ( ) ; $ relateTable = $ this -> getParentTableName ( ) ; $ pmk = $ this -> getParentPrimaryKey ( ) ; $ onClause = "{$table}.{$this->getForeignKey()} = " . "{$relateTable}.{$pmk}" ; $ query = $ event -> getQuery ( ) ; $ query -> join ( $ relateTable , $ onClause , $ fields , $ relateTable ) ; }
Handles the before select callback

@param Select $event
Handles the before select callback