For example my project has parts, the initialize function of my project model looks like this:
/**
* Initialize method for model.
*/
public function initialize()
{
$this->hasMany("id", "Parts", "project_id", array("alias" => "Parts"));
$this->belongsTo("creator_id", "Users", "id", NULL);
$this->hasManyToMany(
"id",
"ProjectHasEmployees",
"project_id", "employee_id",
"Users",
"id",
array("alias" => "employees")
);
$this->belongsTo("type_id", "ProjectType", "id", array("alias" => "type"));
}
I want to order the hasMany relation of my project model.
The documentation shows this:
public Phalcon\Mvc\Model\Relation belongsTo (mixed $fields, string $referenceModel, mixed $referencedFields, [array $options])
How can I tell what the options are? The last parameter. Multiple times in the documentation i see an parameter like [array $options], how can I tell what options I can put in? Is there an option to set the order by of my relationsships like hasMany,belongsTo etc? And also can I RESTfully change the order an parameter like /orderby/part_priority