We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

need help

Hi!!!

the documentation is an example:

public function getRobotsParts($parameters=null) { return $this->getRelated('RobotsParts', $parameters); }

What is the format of an argument $parameters????

this parametrs for Phalcon\Mvc\Model::find , example (https://phalcon-php-framework-documentation.readthedocs.org/en/latest/reference/models.html?highlight=getRobotsParts#taking-advantage-of-relationships):

$robot = Robots::findFirst(2);

// Robots model has a 1-n (hasMany)
// relationship to RobotsParts then
$robotsParts = $robot->robotsParts;

// Only parts that match conditions
$robotsParts = $robot->getRobotsParts("created_at = '2012-03-15'");

// Or using bound parameters
$robotsParts = $robot->getRobotsParts(array(
    "created_at = :date:",
    "bind" => array("date" => "2012-03-15")
));


42.1k


42.1k

Does it work for hasOne relationship???