Exception: Call to a member function getDefault() on array