public function setObject($object)
    {
        if (!is_object($object)) {
            throw new Exception\InvalidArgumentException(sprintf(
                '%s expects an object argument; received "%s"',
                __METHOD__,
                gettype($object)
            ));
        }

        if (property_exists($this, 'hydrator') && $this->hydrator) {
            $values = $this->getHydrator()->extract($object);
            foreach ($this->getFieldsets() as $name => $fieldset) {
                if (isset($values[$name]) && is_object($values[$name])) {
                    $fieldset->setObject($values[$name]);
                }
            }
        }

        if (property_exists($this, 'object')) {
            $this->object = $object;
        }

        return $this;
    }