public function remove($object, $flush = true)
    {
        $this->isExpectedObject($object);
        $this->objectManager->remove($object);
        if ($flush) {
            $this->flush();
        }
    }
public function remove($object, $flush = true)
    {
        $this->isExpectedObject($object);
        $this->objectManager->remove($object);
        if ($flush) {
            $this->flush();
        }
    }
public function remove ( $ object , $ flush = true ) { $ this -> isExpectedObject ( $ object ) ; $ this -> objectManager -> remove ( $ object ) ; if ( $ flush ) { $ this -> flush ( ) ; } }
Removes the object

@param Object $object
@param bool $flush
@throws InvalidArgumentException
Removes the object