save a Navigation
you can pass the Navigation object or an array with the fields
if you pass an array the keys must be with underscore and not with CamelCase
@param Navigation|array $object
@return Navigation
485534
public function save($object)
    {

        if (is_array($object)) {
            $objectData = $object;
            if ($object['id'] > 0) {
                $object = $this->find($object['id']);
            } else {
                $object = new Navigation();
                $site = $this->siteManager->find($objectData['site']);
                $object->setSite($site);
            }
            if (isset($objectData['site'])) {
                unset($objectData['site']);
            }
            $this->assignArrayToObject($object, $objectData);
        } else if (!($object instanceof Navigation)) {
            $this->addErrorMessage(self::ERROR_WRONG_OBJECT);
        }

        if (!$this->hasError()) {
            $check = $this->navigationManager->save($object);
            if ($check) {
                $this->addSuccessMessage(self::SUCCESS_SAVED);
                return $object;
            }
        }
        return null;
    }
757723
private static function objectToArrayRecursive($object) {
        if (is_object($object))
            $object = (array) $object;
        if (is_array($object)) {
            $new = array();
            foreach ($object as $key => $val) {
                $new[$key] = self::objectToArrayRecursive($val);
            }
        } else
            $new = $object;
        return $new;
    }
95348
public function hydrate(array $data, $object)
    {
        if (!$object instanceof TicketCategory) {
            throw new \InvalidArgumentException('$object must be an instance of TicketCategory');
        }

        return parent::hydrate($data, $object);
    }
1031086
public function set($key, $object) {
        $this->_components[$key] = Registry::set($object);

        return $this;
    }
1064979
private function withDirectObjectReference($object) : self
    {
        Assert::isObject($object, "Direct reference passed to service activator must be object");

        $this->directObjectReference = $object;

        return $this;
    }
1124241
protected function hydrateObjectForm($object)
    {
        $data = array(
            'area_id' => $object->getId(),
            'name' => $object->getName()
        );

        return $this->createForm(AdminForm::AREA_MODIFICATION, 'form', $data);
    }
470149
private function insert($object)
    {
        //TODO: this should only be done if there is a Delete query pending for the same entity table
        $this->manager->commit();

        $query = $this->manager
            ->getDriver()
            ->getQueryBuilder()
            ->insert($this->getTable());

        $query->values(
            $query->createPositionalParameter(
                array_filter(
                    $this->toArray($object),
                    [Utils::class, 'notNull']
                )
            )
        );

        return $this->setFieldValue(
            $object,
            $this->getPrimaryKey(),
            $query->query()
        );
    }
685571
public function map($object, $data)
    {
        $object
            ->setProductId($data['OXID'])
            ->setRatingAverage($data['OXRATING'])
            ->setRatingCount($data['OXRATINGCNT']);

        return $object;
    }
915739
protected function hydrateObjectForm($object)
    {
        $data = [
            'id'          => $object->getId(),
            'code'        => $object->getCode(),
            'type'        => $object->getType(),
            'native'      => $object->getNative(),
            'by_module'   => $object->getByModule(),
            'block'       => $object->getBlock(),
            'active'      => $object->getActivate(),
            'locale'      => $object->getLocale(),
            'title'       => $object->getTitle(),
            'chapo'       => $object->getChapo(),
            'description' => $object->getDescription(),
        ];

        return $this->createForm(AdminForm::HOOK_MODIFICATION, 'form', $data);
    }
40912
public function save($object, $values)
    {
        $value = isset($values[$this->id])
            ? apply_filters('cuztom_field_save_value', $this->parseValue($values[$this->id]), $this)
            : false;

        // Do
        do_action('cuztom_field_save', $this);

        // Save to respective content-type
        switch ($this->metaType) {
            case 'user':
                return (bool) update_user_meta($object, $this->id, $value);
            case 'term':
                return (bool) update_term_meta($object, $this->id, $value);
            case 'post':
                return (bool) update_post_meta($object, $this->id, $value);
        }

        // Default
        return false;
    }
158051
public function hydrate( array $data, $object )
    {
        if ( $object instanceof MapperAwareInterface )
        {
            $object->setMapper( $this );
        }

        if ( $object instanceof Structure )
        {
            if ( ! empty( $data['cssFile'] ) && is_file( $data['cssFile'] ) )
            {
                $object->parseFile( $data['cssFile'] );
            }
            else if ( ! empty( $data['css'] ) )
            {
                $object->parseString( $data['css'] );
            }
        }
        else
        {
            if ( ! empty( $data['cssFile'] ) && is_file( $data['cssFile'] ) )
            {
                $object->css = file_get_contents( $data['cssFile'] );
            }
            else if ( ! empty( $data['css'] ) )
            {
                $object->css = (string) $data['css'];
            }
        }

        if ( array_key_exists( 'rootId', $data ) )
        {
            $object->rootId = $data['rootId'];
        }

        return $object;
    }
136233
public function save($object)
    {

        if (is_array($object)) {
            $objectData = $object;
            if (isset($object['id']) && $object['id'] > 0) {
                $object = $this->find($object['id']);
            } else {
                $object = new Forum();
            }
            if (isset($objectData['parent'])) {
                $parent = $this->find($objectData['parent']);
                if ($parent) {
                    $object->setParent($parent);
                }
                unset($objectData['parent']);
            }
            $this->assignArrayToObject($object, $objectData);
        } else if (!($object instanceof Forum)) {
            $this->addErrorMessage(self::ERROR_WRONG_OBJECT);
        }

        if (!$this->hasError()) {
            $check = $this->forumManager->update($object);
            if ($check === true) {
                $this->addSuccessMessage(self::SUCCESS_SAVED);
            }
        }

        return $object;
    }
978364
protected function recordObjectContent($object)
	{
		foreach ($object as $k => $v)
		{
			if ($this->canDeduplicate($v) && !$this->shouldPreserve($v))
			{
				$object[$k] = $this->recordObject($v);
			}
		}

		return $object;
	}
1190702
public static function modelSaveMethod($object)
    {
        if (is_object($object)) {
            if (in_array('Ornament\Model', class_uses($object))
                || method_exists($object, 'save')
            ) {
                return 'save';
            }
        }
        return null;
    }
783082
public function hydrate( array $data, $object )
    {
        $type = $object->paragraph->type;

        if ( isset( $data['paragraph-' . $type] ) )
        {
            $this->getParagraphMapper()
                 ->hydrate( (array) $data['paragraph-' . $type],
                            $object->paragraph );
        }

        $propertyHydrator = $this->getHydrateSimpleProperties();

        foreach ( $object->rules as $key => $rule )
        {
            if ( isset( $data['customize-' . $key] ) )
            {
                $ruleData = array(
                    'properties' => (array) $data['customize-' . $key],
                );

                $propertyHydrator->hydrate( $ruleData, $rule );
            }
        }

        return $object;
    }
804263
public function hydrate(array $data, $object)
    {
        if (!$object instanceof PageInfo) {
            throw new \Exception('$object must be an instance of PageInfo');
        }

        return parent::hydrate($data, $object);
    }
99457
public function hydrate(array $data, $object)
    {
        $object->setId($data['id']);
        $object->setLogin($data['login']);
        $object->setName($data['name']);
        $object->setEmail($data['email']);
        $object->setRole($data['role']);
        return $object;
    }