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;
    }
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;
    }
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 ; }
Called to validate an entity. By deafult it validates all the entity
properties.

@param AnDomainEntityAbstract $entity The entity that is being validated

@return bool
Called to validate an entity . By deafult it validates all the entity properties .