public function validateEntity($entity)
    {
        $description = $entity->getEntityDescription();

        //if entity is persisted only look at the modified
        //properties
        if ($entity->isModified()) {
            $properties = array_intersect_key($description->getProperty(), AnConfig::unbox($entity->getModifiedData()));
        } else {
            $properties = $description->getProperty();
        }

        foreach ($properties as $property) {
            $value = $entity->get($property->getName());
            $entity->getValidator()->validateData($entity, $property, $value);
        }

        return $entity->getErrors()->count() === 0;
    }