Index: branches/5.2.x/core/units/favorites/favorites_eh.php =================================================================== diff -u -N -r15145 -r16513 --- branches/5.2.x/core/units/favorites/favorites_eh.php (.../favorites_eh.php) (revision 15145) +++ branches/5.2.x/core/units/favorites/favorites_eh.php (.../favorites_eh.php) (revision 16513) @@ -1,6 +1,6 @@ Application->getUnitOption($event->Prefix, 'ParentPrefix'); + + /** @var kDBItem $parent_object */ $parent_object = $this->Application->recallObject($parent_prefix); - /* @var $parent_object kDBItem */ if (!$parent_object->isLoaded() || !$this->Application->CheckPermission('FAVORITES', 0, $parent_object->GetDBField('ParentPath'))) { $event->status = kEvent::erPERM_FAIL; @@ -56,8 +57,8 @@ WHERE (PortalUserId = '.$user_id.') AND (ResourceId = '.$parent_object->GetDBField('ResourceId').')'; $favorite_id = $this->Conn->GetOne($sql); + /** @var kDBItem $object */ $object = $event->getObject(Array('skip_autoload' => true)); - /* @var $object kDBItem */ if ($favorite_id) { $object->Delete($favorite_id); @@ -80,15 +81,16 @@ { parent::OnBeforeItemCreate($event); + /** @var kDBItem $object */ $object = $event->getObject(); - /* @var $object kDBItem */ $user_id = $this->Application->RecallVar('user_id'); $object->SetDBField('PortalUserId', $user_id); $parent_prefix = $this->Application->getUnitOption($event->Prefix, 'ParentPrefix'); + + /** @var kDBItem $parent_object */ $parent_object = $this->Application->recallObject($parent_prefix); - /* @var $parent_object kDBItem */ $object->SetDBField('ResourceId', $parent_object->GetDBField('ResourceId')); $object->SetDBField('ItemTypeId', $this->Application->getUnitOption($parent_prefix, 'ItemType'));