{@inheritdoc}

@param BaseBlock $object
509658
public function preRemove($object): void
    {
        /** @var BlockAdmin $block */
        $block = $this->blockManager->get($object);
        $block->preRemove($object);
    }
716818
public function postUpdate($object): void
    {
        /** @var BlockAdmin $block */
        $blockManager = $this->blockManager;

        $block = $blockManager->get($object);
        $block->postUpdate($object);

        $service = $blockManager->get($object);

        $this->cacheManager->invalidate($service->getCacheKeys($object));
    }
1079710
protected function doExtract($object)
    {
        $originalFieldNames = $this->metadata->getOriginalFieldNames();

        /*
        $filter = $object instanceof FilterProviderInterface
            ? $object->getFilter()
            : $this->filterComposite;
        */

        $data = [];
        if (! $this->metadata->hasCustomHydrator()) {

            $this->executeMethods($object, $this->metadata->getPreExtractListeners());

            foreach ($originalFieldNames as $originalFieldName) {
                $mappedFieldName = $this->metadata->getMappedFieldName($originalFieldName);

                if ($this->metadata->isNotManaged($mappedFieldName)) {
                    continue;
                }

                if ($this->metadata->isValueObject($mappedFieldName)) {
                    continue;
                }

                /*if ($filter && !$filter->filter($mappedFieldName)) {
                    continue;
                }*/

                try {
                    $value = $this->memberAccessStrategy->getValue($object, $mappedFieldName);             
                } catch (NotFoundMemberException $e) {
                    continue;
                }

                if (null === $value) {
                    $data[$originalFieldName] = null;
                    continue;
                }

                if ($fieldClass = $this->metadata->getClassOfMappedField($mappedFieldName)) {
                    $fieldHydrator = $this->objectManager->createHydratorFor($fieldClass);
                    $fieldValue = $value;

                    /*if (! is_array($fieldValue)) {
                        throw new ObjectMappingException(
                            sprintf(
                                'Cannot hydrate field "%s" of class "%s" from raw data.'
                                . ' Raw data should be an array but got "%s".', 
                                $mappedFieldName,
                                $fieldClass,
                                is_object($fieldValue) ? get_class($fieldValue) : gettype($fieldValue)
                                )
                        );
                    }   */
                    
                    reset($fieldValue);
                    if (0 !== count($fieldValue) && ! is_numeric(key($fieldValue))) {
                        $fieldRawData = $fieldHydrator->extract($fieldValue);
                        $data[$originalFieldName] = $fieldRawData;                              
                    } else {

                        $fieldRawData = [];
                        foreach ($fieldValue as $itemFieldValue) {              
                            $fieldRawData[] = $fieldHydrator->extract($itemFieldValue);                
                        }
                        $data[$originalFieldName] = $fieldRawData;
                    }   
                } else {
                    $value = $this->extractValue($mappedFieldName, $value, $object, $data);
                    $data[$originalFieldName] = $value;    
                }
            }
        } else {
            list($customHydratorClass, , $customExtractMethod) = $this->metadata->getCustomHydratorInfo();            
            $this->executeMethod($object, new ClassMetadata\Model\Method($customHydratorClass, $customExtractMethod, [$object]));
        }

        //Value objects extraction.
        foreach ($this->metadata->getFieldsWithValueObjects() as $mappedFieldName) {

            if ($this->metadata->isNotManaged($mappedFieldName)) {
                continue;
            }

            $info = $this->metadata->getValueObjectInfo($mappedFieldName);
            list($voClassName, $voResource, $voResourceType) = $info;

            $valueObjectHydrator = $this->objectManager->createHydratorFor($voClassName);
            $objectKey = $this->pushRuntimeConfiguration($mappedFieldName, $object, $voClassName, $voResourceType, $voResource);

            $valueObject = $this->memberAccessStrategy->getValue($object, $mappedFieldName);
            $valueObjectData = $valueObjectHydrator->extract($valueObject, $objectKey);
            $this->popRuntimeConfiguration();

            $data = array_merge($data, $valueObjectData);
        }

        $this->executeMethods($object, $this->metadata->getPostExtractListeners());

        return $data;
    }
325501
public function apply(object $object, ReflectionProperty $reflectionProperty, callable $objectCopier): void
    {
        $reflectionProperty->setAccessible(true);
        /** @var Collection $oldCollection */
        $oldCollection = $reflectionProperty->getValue($object);

        $newCollection = $oldCollection->map(
            function ($item) use ($objectCopier) {
                return $objectCopier($item);
            }
        );

        $reflectionProperty->setValue($object, $newCollection);
    }
726125
protected function unbindContext($object, $terminate = true)
	{
		if(!is_object($object))
		{
			throw new \InvalidArgumentException(sprintf('Expecting an object, given %s', gettype($object)));
		}
	
		if($this->context === $object)
		{
			$this->context = NULL;
			$this->proxies = new \SplObjectStorage();
		}
		
		if($terminate && $this->contextualInstances->offsetExists($object))
		{
			unset($this->contextualInstances[$object]);
		}
	}
37394
public function writeObject($object)
    {
        // Loop each element and write the name of the property.
        foreach ($object as $key => &$value) {
            // skip variables starting with an _ private transient
            if( $key[0] == "_") continue;
            $this->_stream->writeUTF($key);
            $this->writeTypeMarker($value);
        }

        // Write the end object flag
        $this->_stream->writeInt(0);
        $this->_stream->writeByte(Zend_Amf_Constants::AMF0_OBJECTTERM);
        return $this;
    }
1012998
public function inject($object) : void
    {
        $reflection = new \ReflectionObject($object);

        $this->injectProperties($reflection, $object);
        $this->injectMethods($reflection, $object);
    }
649488
public function remove($object) : void
    {
        $hash = spl_object_hash($object);

        unset($this->objects[$hash]);
        unset($this->data[$hash]);
    }
480904
public function setInstance($object, $abstract = null)
    {
        if (!is_object($object)) {
            throw new \InvalidArgumentException('$object must be an object');
        }
        if ($abstract === null) {
            //If $abstract is not specified, use $objects class
            $abstract = get_class($object);
        } elseif ($abstract[0] === '\\') {
            //Strip all leading backslashes
            $abstract = substr($abstract, 1);
        }
        $concrete = $this->findMostConcreteDefinition($abstract);
        if (isset($this->objects[$concrete])) {
            //If this class already has an instance, we'll return the old object
            $old = $this->objects[$concrete];
        } else {
            $old = false;
        }
        //Store the object
        $this->objects[$concrete] = $object;

        return $old;
    }
695447
public function set($key, $object) {
		
		if (! is_object($object)) {
			throw new \InvalidArgumentException("Registry only accepts objects, given: ".gettype($object));
		}
		
		$this->_data[$key] = $object;
		
		return $this;
	}
386234
protected function doFilter($object): void
    {
        $clearAll = false;
        $id = spl_object_hash($object);
        array_splice($this->toFilter, array_search($id, $this->toFilter, true), 1);

        if (!$this->isViewGranted($object)) {
            $clearAll = true;
        }

        $ref = new \ReflectionClass($object);

        foreach ($ref->getProperties() as $property) {
            $property->setAccessible(true);
            $fieldVote = new FieldVote($object, $property->getName());
            $value = $property->getValue($object);

            if ($this->isFilterViewGranted($fieldVote, $value, $clearAll)) {
                $value = $this->ofe->filterValue($value);
                $property->setValue($object, $value);
            }
        }
    }
1041511
public static function reset($object)
	{
		if (!($object instanceof ExtensionRange)) {
			throw new \InvalidArgumentException('You have to pass object of class Google\Protobuf\DescriptorProto\ExtensionRange.');
		}
		$object->start = NULL;
		$object->end = NULL;
	}
485711
protected function setDomainObjectInProperty($object, $propertyName, $domainObject, $lastObject, array $objectArrayPropertyPath)
    {
        if (is_object($object)) {
            ObjectAccess::setProperty($object, $propertyName, $domainObject);
        } elseif (is_array($object)) {
            $this->injectDomainObjectInLastObject($domainObject, $lastObject, $objectArrayPropertyPath);
        }
    }
983131
private function renderParentBlock(Template $parent, $blockName, Context $context)
    {
        while ($parent->parentTemplate) {
            $parent = $this->environment->load($parent->parentTemplate);
            if (isset($parent->blocks[ $blockName ])) {
                $parent->blocks[$blockName]($context);

                return;
            }
        }

        throw new \RuntimeException("Block {$blockName} was not found.");
    }
654449
public function removeBlock(Block $block)
	{
		if (! $this->equals($block->getPlaceHolder())
				|| ! $this->blocks->contains($block)) {
			throw new \InvalidArgumentException('Block does not belongs to this placeholder.');
		}

		$position = $block->getPosition();
	
		$this->blocks->removeElement($block);

		foreach ($this->blocks as $existingBlock) {
			if ($existingBlock->getPosition() > $position) {
				$existingBlock->setPosition($existingBlock->getPosition() - 1);
			}
		}
	}
602484
protected function doValidateObject($object)
    {
        if ($object === null || (empty($object) && $object !==0 && $object !=='0') )
            throw new \InvalidArgumentException(sprintf(
                'Object can`t be empty, given: (%s).'
                , \Poirot\Std\flatten($object)
            ));
    }
266503
public static function set($object, $key = null) {
        if (!is_object($object)) {
            throw new InvalidObjectException('The object to register must be instantiated');
        }

        if (!$key) {
            $key = get_class($object);
        }

        static::$_registered[$key] = $object;

        return $object;
    }