public function applyAttributes(Resource $entity, $data)
    {
        $this->validateData($data);
        $meta = $this->em->getMetadataFor($entity->getType());
        foreach ($meta->getAttributes() as $key => $attribute) {
            if (!isset($data[$key])) {
                continue;
            }
            $this->applyAttribute($entity, $key, $data[$key]);
        }
        return $this;
    }
public function applyAttributes(Resource $entity, $data)
    {
        $this->validateData($data);
        $meta = $this->em->getMetadataFor($entity->getType());
        foreach ($meta->getAttributes() as $key => $attribute) {
            if (!isset($data[$key])) {
                continue;
            }
            $this->applyAttribute($entity, $key, $data[$key]);
        }
        return $this;
    }
public function applyAttributes ( Resource $ entity , $ data ) { $ this -> validateData ( $ data ) ; $ meta = $ this -> em -> getMetadataFor ( $ entity -> getType ( ) ) ; foreach ( $ meta -> getAttributes ( ) as $ key => $ attribute ) { if ( ! isset ( $ data [ $ key ] ) ) { continue ; } $ this -> applyAttribute ( $ entity , $ key , $ data [ $ key ] ) ; } return $ this ; }
Applies an array or array-like set of attribute data to an entity.
Each array member must be keyed by the attribute field key.

@param   Entity              $entity     The entity to apply the attributes to.
@param   array|\ArrayAccess  $data       The attribute data to apply.
@return  self
Applies an array or array - like set of attribute data to an entity . Each array member must be keyed by the attribute field key .