Adopt the data from $self
@param AbstractModel $self
@return self
978472
protected function reload(AbstractModel $self)
    {
        $this->_initVars();
        $this->extract($self->selfToArray(), false);
        return $this;
    }
512222
public function expression($value) : self
    {
        $this->requiresCurrentField(__METHOD__);
        $this->expr[$this->currentField] = $this->ensureArray($value);

        return $this;
    }
400996
public function add(self $other): self
    {
        return self::from($this->value + $other->value);
    }
1238907
public function map(callable $func = null): self
    {
        if (null === $func) {
            return $this;
        }

        return parent::map($func);
    }
766721
public function add(AbstractModel $model)
    {
        if (! $this->has($model)) {
            $this->addShallow($model);

            $modelLinks = $model->getRepo()->getLinkMap()->get($model);

            foreach ($modelLinks->getModels() as $linkedModel) {
                $this->add($linkedModel);
            }
        }

        return $this;
    }
405925
public static function create(ChannelResolver $channelResolver, MessageProcessor $messageProcessor, bool $isResolutionRequired, ?string $defaultResolutionChannel, bool $applySequence) : self
    {
        return new self($channelResolver, $messageProcessor, $isResolutionRequired, $defaultResolutionChannel, $applySequence);
    }
388000
public function withData($data): self
    {
        $new = clone $this;
        $new->data = $data instanceof MessageData ? $data : MessageData::fromArray($data);

        return $new;
    }
1247893
public function persist(object $entity): self
    {
        $identity = $this->extractIdentity($entity);

        if (!$this->container->contains($identity)) {
            $meta = ($this->metadata)(get_class($entity));
            $this->container->push(
                $identity,
                $entity,
                State::new()
            );
            $this
                ->generators
                ->get($meta->identity()->type())
                ->add($identity);
        }

        return $this;
    }
57240
public static function instance(): self
    {
        if (!self::$instance) {
            self::$instance = new self(
                Sequencer::sequence('mock-label'),
                MockGenerator::instance(),
                HandleFactory::instance()
            );
        }

        return self::$instance;
    }
911864
public function data($key, $value=null) :self {
		// if we have an array of data
		if(is_array($key)) {
			// for each of those
			foreach($key as $index => $value) {
				// set them
				$this->data($index, $value);
			}
		}
		else {
			// set a value
			$this->data[$key] = $value;
		}
		// return self
		return $this;
	}
781429
public function withName(string $name): self
    {
        $self = clone $this;
        $self->name = $name;

        return $self;
    }
135090
public function from($values): self
    {
        if (!empty($values)) {
            $this->properties['from'] = collect($values)->map(function ($value) {
                return trim($value);
            })->all();
        }

        return $this;
    }
763147
public static function create($condition): self
    {
        $condition = $condition instanceof Condition ? $condition : Condition::fromValue($condition);

        return new self($condition);
    }
752249
public function withMethod(string $method): self {
        if ($this->method === $method) {
            return $this;
        }

        $clone = clone $this;
        $clone->method = $method;

        return $clone;
    }
226775
public function setModel(Model $model)
    {
        parent::setModel($model);
        $this->setHtmlAttribute('data-value', $this->getModelValue());

        return $this;
    }
1355698
public function _beforeSave(AbstractModel $object)
    {

        $object->setUpdatedAt($this->date->gmtDate());
        
        if ($object->isObjectNew()) {
            $object->setCreatedAt($this->date->gmtDate());
        }

        return parent::_beforeSave($object);
    }
379118
public static function init(): self
    {
        if (self::$instance == null) {
            self::$instance = new self();
        }

        return self::$instance;
    }