Stevebauman\Inventory\Traits\AssemblyTrait::validatePartAgainstList PHP Метод

validatePartAgainstList() защищенный Метод

Validates the value and key of the values from the assemblies item list to verify that it does not equal the current items ID.
protected validatePartAgainstList ( mixed $value, integer | string $key )
$value mixed
$key integer | string
    protected function validatePartAgainstList($value, $key)
    {
        if ((string) $key === (string) $this->getKeyName()) {
            if ((int) $value === (int) $this->getKey()) {
                $message = 'The inserted part exists inside the assembly tree. An item cannot be an assembly of itself.';
                throw new InvalidPartException($message);
            }
        }
    }