gossi\codegen\model\parts\PropertiesPart::removeProperty PHP Method

removeProperty() public method

Removes a property
public removeProperty ( PhpProperty | string $nameOrProperty )
$nameOrProperty gossi\codegen\model\PhpProperty | string property name or instance
    public function removeProperty($nameOrProperty)
    {
        if ($nameOrProperty instanceof PhpProperty) {
            $nameOrProperty = $nameOrProperty->getName();
        }
        if (!$this->properties->has($nameOrProperty)) {
            throw new \InvalidArgumentException(sprintf('The property "%s" does not exist.', $nameOrProperty));
        }
        $p = $this->properties->get($nameOrProperty);
        $p->setParent(null);
        $this->properties->remove($nameOrProperty);
        return $this;
    }