public function removeRandom()
    {
        $index = array_rand($this->entities);
        $entity = $this->entities[$index];
        unset($this->entities[$index]);

        return $entity;
    }
public function removeRandom()
    {
        $index = array_rand($this->entities);
        $entity = $this->entities[$index];
        unset($this->entities[$index]);

        return $entity;
    }
public function removeRandom ( ) { $ index = array_rand ( $ this -> entities ) ; $ entity = $ this -> entities [ $ index ] ; unset ( $ this -> entities [ $ index ] ) ; return $ entity ; }
Remove a random Entity from this collection, or null if the
collection is empty.

@return Entity|null
Remove a random Entity from this collection or null if the collection is empty .