true, 'targetClass' => RoadPassport::className(), 'targetAttribute' => ['road_passport_id' => 'road_passport_id']], [['km'], 'number', 'min' => $this->roadPassport->begin, 'max' => $this->roadPassport->end], ]; } /** * @inheritdoc */ public function attributeLabels() { return [ 'point_id' => 'Point ID', 'road_passport_id' => 'Road Passport ID', 'lat' => 'Lat', 'lng' => 'Lng', 'km' => 'Km', 'num' => 'Num', ]; } /** * @return \yii\db\ActiveQuery */ public function getRoadPassport() { return $this->hasOne(RoadPassport::className(), ['road_passport_id' => 'road_passport_id'])->inverseOf('points'); } }