protected function getEntitiesFromDataArray(array $entitiesArray)
    {
        $entities = array();
        foreach ($entitiesArray as $entityArray) {
            $entity = new Entity();

            if (isset($entityArray['class']) && is_array($entityArray['class'])) {
                $entity->setClass($entityArray['class']);
            }

            if (isset($entityArray['rel']) && is_array($entityArray['rel'])) {
                $entity->setRel($entityArray['rel']);
            }

            if (isset($entityArray['href']) && is_string($entityArray['href'])) {
                $entity->setHref($entityArray['href']);
            }

            if (isset($entityArray['properties']) && is_array($entityArray['properties'])) {
                $entity->setProperties($entityArray['properties']);
            }

            if (isset($entityArray['links']) && is_array($entityArray['links'])) {
                $links = $this->getLinksFromDataArray($entityArray['links']);
                $entity->setLinks($links);
            }

            $entities[] = $entity;
        }

        return $entities;
    }