@harikt is correct here. This is a trait, so we can't guarantee the presence of a $data element in classes that use the trait. This is a fine fix for GenericEntity but it won't go so well in a Trait.