/**
  * Return all the link objects for embedded resources
  *
  * @param Gedcomx $entity
  *
  * @return array
  */
 public function loadEmbeddedLinks(Gedcomx $entity)
 {
     $embeddedLinks = array();
     $embeddedRels = $this->getEmbeddedLinkRels();
     $persons = $entity->getPersons();
     if ($persons != null) {
         foreach ($persons as $person) {
             foreach ($embeddedRels as $rel) {
                 $link = $person->getLink($rel);
                 if ($link != null) {
                     $embeddedLinks[] = $link;
                 }
             }
         }
     }
     $relationships = $entity->getRelationships();
     if ($relationships != null) {
         foreach ($relationships as $relationship) {
             foreach ($embeddedRels as $rel) {
                 $link = $relationship->getLink($rel);
                 if ($link != null) {
                     $embeddedLinks[] = $link;
                 }
             }
         }
     }
     return $embeddedLinks;
 }