Mvc\Model\Query\Builder::addFrom

public addFrom (mixed $model, [mixed $alias], [mixed $with])

Add a model to take part of the query

// Load data from models Robots
$builder->addFrom('Robots');

  // Load data from model 'Robots' using 'r' as alias in PHQL
$builder->addFrom('Robots', 'r');

  // Load data from model 'Robots' using 'r' as alias in PHQL
  // and eager load model 'RobotsParts'
$builder->addFrom('Robots', 'r', 'RobotsParts');

  // Load data from model 'Robots' using 'r' as alias in PHQL
  // and eager load models 'RobotsParts' and 'Parts'
$builder->addFrom('Robots', 'r', ['RobotsParts', 'Parts']);
doc_Phalcon
2016-10-16 09:54:28
Comments
Leave a Comment

Please login to continue.