/** * * @param type $fieldName * @return Uploads\models\UploadsCollection */ protected function getOwnersCollectionByFieldName($fieldName) { if (!isset($this->ownersCollection[$fieldName])) { $colection = new UploadsCollection(); if ($this->ownerCollectionExists($fieldName)) { $collectionId = (int) $this->behavior->owner->getOldAttribute($fieldName); $colection->setAttribute('id', $collectionId); $colection->loadDefaultValues(); $colection->isNewRecord = false; } $this->ownersCollection[$fieldName] = $colection; } return $this->ownersCollection[$fieldName]; }