Takes a class an returns an array of it's public and protected
properties as an array suitable for use in creates and updates.

@param string|object $data
@param string|null   $primaryKey
@param string        $dateFormat
@param boolean       $onlyChanged

@return array
@throws \ReflectionException