💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
# Class Phalcon\\Mvc\\Model\\Relation # Class **Phalcon\\Mvc\\Model\\Relation** *implements*[*Phalcon\\Mvc\\Model\\RelationInterface*](#) This class represents a relationship between two models ### Constants *integer***BELONGS\_TO** *integer***HAS\_ONE** *integer***HAS\_MANY** *integer***HAS\_ONE\_THROUGH** *integer***HAS\_MANY\_THROUGH** *integer***NO\_ACTION** *integer***ACTION\_RESTRICT** *integer***ACTION\_CASCADE** ### Methods public **\_\_construct** (*int* $type, *string* $referencedModel, *string|array* $fields, *string|array* $referencedFields, \[*array* $options\]) Phalcon\\Mvc\\Model\\Relation constructor public **setIntermediateRelation** (*string|array* $intermediateFields, *string* $intermediateModel, *string* $intermediateReferencedFields) Sets the intermediate model data for has-[\*](#)-through relations public **getType** () Returns the relation type public **getReferencedModel** () Returns the referenced model public *string|array***getFields** () Returns the fields public *string|array***getReferencedFields** () Returns the referenced fields public *string|array***getOptions** () Returns the options public **isForeignKey** () Check whether the relation act as a foreign key public *string|array***getForeignKey** () Returns the foreign key configuration public *array***getParams** () Returns parameters that must be always used when the related records are obtained public **isThrough** () Check whether the relation is a ‘many-to-many' relation or not public **isReusable** () Check if records returned by getting belongs-to/has-many are implicitly cached during the current request public *string|array***getIntermediateFields** () Gets the intermediate fields for has-[\*](#)-through relations public **getIntermediateModel** () Gets the intermediate model for has-[\*](#)-through relations public *string|array***getIntermediateReferencedFields** () Gets the intermediate referenced fields for has-[\*](#)-through relations | - [索引](# "总目录") - [下一页](# "Abstract class Phalcon\Mvc\Model\Resultset") | - [上一页](# "Class Phalcon\Mvc\Model\Query\Status") | - [API Indice](#) »