Instead, in order to be able to access it' s own functions and variables from within a class, one can use the pseudo-variable $this which can be read as'my own 'or'current object'.
Donc, vous ne pouvez pas utiliser la syntaxe $cart - items.