public function extract(array $properties, $onlyDirty = false)
    {
        $result = [];
        foreach ($properties as $property) {
            if (!$onlyDirty || $this->isDirty($property)) {
                $result[$property] = $this->get($property);
            }
        }

        return $result;
    }
public function extract(array $properties, $onlyDirty = false)
    {
        $result = [];
        foreach ($properties as $property) {
            if (!$onlyDirty || $this->isDirty($property)) {
                $result[$property] = $this->get($property);
            }
        }

        return $result;
    }
public function extract ( array $ properties , $ onlyDirty = false ) { $ result = [ ] ; foreach ( $ properties as $ property ) { if ( ! $ onlyDirty || $ this -> isDirty ( $ property ) ) { $ result [ $ property ] = $ this -> get ( $ property ) ; } } return $ result ; }
Returns an array with the requested properties
stored in this entity, indexed by property name

@param array $properties list of properties to be returned
@param bool $onlyDirty Return the requested property only if it is dirty
@return array
Returns an array with the requested properties stored in this entity indexed by property name