/** * checks for replated property and deletes if found * * @return return_type * @param var_type $var */ private function deleteReciprocalProperty($propertyId, $relatedIdFromRequest = '') { //retrieve the existing property if (isset($propertyId)) { /* @var ConceptProperty */ $currentProperty = ConceptPropertyPeer::retrieveByPk($propertyId); } if (isset($currentProperty)) { //check to see if it defines a relationship $currentRelatedSchemeId = $currentProperty->getSchemeId(); $currentRelatedConceptId = $currentProperty->getRelatedConceptId(); $currentRelatedConceptInverseSkosId = $currentProperty->getProfileProperty()->getInverseProfilePropertyId(); //if it does and it doesn't match the current relationship if (isset($currentRelatedConceptId) && $currentRelatedConceptId != $relatedIdFromRequest) { //retrieve the related property $c = new Criteria(); $c->add(ConceptPropertyPeer::CONCEPT_ID, $currentRelatedConceptId); $c->add(ConceptPropertyPeer::SKOS_PROPERTY_ID, $currentRelatedConceptInverseSkosId); /* @var ConceptProperty */ $relatedProperty = ConceptPropertyPeer::doSelectOne($c); if (isset($relatedProperty)) { //then delete it try { $relatedProperty->delete(); } catch (PropelException $e) { $this->getRequest()->setError('delete', 'Could not delete the related Concept Property.'); } } } } return; }