Mvc\Model\Query\Builder::join

public Phalcon\Mvc\Model\Query\Builder join (string $model, [string $conditions], [string $alias], [string $type])

Adds an INNER join to the query

// Inner Join model 'Robots' with automatic conditions and alias
$builder->join('Robots');

  // Inner Join model 'Robots' specifing conditions
$builder->join('Robots', 'Robots.id = RobotsParts.robots_id');

  // Inner Join model 'Robots' specifing conditions and alias
$builder->join('Robots', 'r.id = RobotsParts.robots_id', 'r');

  // Left Join model 'Robots' specifing conditions, alias and type of join
$builder->join('Robots', 'r.id = RobotsParts.robots_id', 'r', 'LEFT');
doc_Phalcon
2016-10-16 09:54:32
Comments
Leave a Comment

Please login to continue.