public static function createFromApiResult($apiResult, BaseResource $resource)
    {
        foreach ($apiResult as $property => $value) {
            $resource->{$property} = $value;
        }

        return $resource;
    }
public static function createFromApiResult($apiResult, BaseResource $resource)
    {
        foreach ($apiResult as $property => $value) {
            $resource->{$property} = $value;
        }

        return $resource;
    }
public static function createFromApiResult ( $ apiResult , BaseResource $ resource ) { foreach ( $ apiResult as $ property => $ value ) { $ resource -> { $ property } = $ value ; } return $ resource ; }
Create resource object from Api result

@param object $apiResult
@param BaseResource $resource

@return BaseResource
Create resource object from Api result