src/COCEntity.php
public static function fill(array $data, COCEntity &$entity)
    {
        $vars = get_object_vars($entity);
        foreach ($vars as $var => $_) {
            if (array_key_exists($var, $data)) {
                $entity->{$var} = $data[$var];
            }
        }
    }
public static function fill(array $data, COCEntity &$entity)
    {
        $vars = get_object_vars($entity);
        foreach ($vars as $var => $_) {
            if (array_key_exists($var, $data)) {
                $entity->{$var} = $data[$var];
            }
        }
    }
public static function fill ( array $ data , COCEntity & $ entity ) { $ vars = get_object_vars ( $ entity ) ; foreach ( $ vars as $ var => $ _ ) { if ( array_key_exists ( $ var , $ data ) ) { $ entity -> { $ var } = $ data [ $ var ] ; } } }
Fills the data from an array into the given class
@param array     $data   the data which will be filled into the class
@param COCEntity $entity the cocentity child which need to be filled
@return void
Fills the data from an array into the given class