src/ORM/DataObject.php
public function setJoin(DataObject $object, $alias = null)
    {
        $this->joinRecord = $object;
        if ($alias) {
            if (static::getSchema()->fieldSpec(static::class, $alias)) {
                throw new InvalidArgumentException(
                    "Joined record $alias cannot also be a db field"
                );
            }
            $this->record[$alias] = $object;
        }
        return $this;
    }
public function setJoin(DataObject $object, $alias = null)
    {
        $this->joinRecord = $object;
        if ($alias) {
            if (static::getSchema()->fieldSpec(static::class, $alias)) {
                throw new InvalidArgumentException(
                    "Joined record $alias cannot also be a db field"
                );
            }
            $this->record[$alias] = $object;
        }
        return $this;
    }
public function setJoin ( DataObject $ object , $ alias = null ) { $ this -> joinRecord = $ object ; if ( $ alias ) { if ( static :: getSchema ( ) -> fieldSpec ( static :: class , $ alias ) ) { throw new InvalidArgumentException ( "Joined record $alias cannot also be a db field" ) ; } $ this -> record [ $ alias ] = $ object ; } return $ this ; }
Set joining object

@param DataObject $object
@param string $alias Alias
@return $this
Set joining object