/** * Join other related objects into a collection for the purpose of filtering. Relationships * is either a flat array of relationships (as defined in the object's schema) or a nested array * @chainable */ public function join($rels, $joinType = 'inner') { $schemaAlias = $this->_schema->alias(); foreach (Relationship::normalizeMap($rels) as $alias => $nested) { Relationship::addJoin($this->_queryForWrite(), $schemaAlias, $this->_schema, $alias, $nested, $joinType); } return $this; }