Fill metabox fields.

@param \WP_Post|\WP_Comment $object
@param void
557061
public function fill($object)
    {
        if ($this->screenIsComment()) {
            $this->model->setContext('comment');

            return parent::prepare($object->comment_ID);
        }

        return parent::prepare($object->ID);
    }
79539
public function Form($object)
    {
        $inChangeSets = $this->getInChangeSets($object);
        $inChangeSetIDs = $inChangeSets->column('ID');

        // Get changesets that can be added to
        $candidateChangeSets = $this->getAvailableChangeSets();
        if ($inChangeSetIDs) {
            $candidateChangeSets = $candidateChangeSets->exclude('ID', $inChangeSetIDs);
        }

        $canCreate = ChangeSet::singleton()->canCreate();
        $message = $this->getFormAlert($inChangeSets, $candidateChangeSets, $canCreate);
        $fields = new FieldList(array_filter([
            $message ? LiteralField::create("AlertMessages", $message) : null,
            HiddenField::create('ID', null, $object->ID),
            HiddenField::create('ClassName', null, $object->baseClass())
        ]));

        // Add fields based on available options
        $showSelect = $candidateChangeSets->count() > 0;
        if ($showSelect) {
            $campaignDropdown = DropdownField::create(
                'Campaign',
                _t(__CLASS__ . '.AddToCampaignAvailableLabel', 'Available campaigns'),
                $candidateChangeSets
            )
                ->setEmptyString(_t(__CLASS__ . '.AddToCampaignFormFieldLabel', 'Select a Campaign'))
                ->addExtraClass('noborder')
                ->addExtraClass('no-chosen');
            $fields->push($campaignDropdown);

            // Show visibilty toggle of other create field
            if ($canCreate) {
                $addCampaignSelect = CheckboxField::create('AddNewSelect', _t(
                    __CLASS__ . '.ADD_TO_A_NEW_CAMPAIGN',
                    'Add to a new campaign'
                ))
                    ->setAttribute('data-shows', 'NewTitle')
                    ->setSchemaData(['data' => ['shows' => 'NewTitle']]);
                $fields->push($addCampaignSelect);
            }
        }
        if ($canCreate) {
            $placeholder = _t(__CLASS__ . '.CREATE_NEW_PLACEHOLDER', 'Enter campaign name');
            $createBox = TextField::create(
                'NewTitle',
                _t(__CLASS__ . '.CREATE_NEW', 'Create a new campaign')
            )
                ->setAttribute('placeholder', $placeholder)
                ->setSchemaData(['attributes' => ['placeholder' => $placeholder]]);
            $fields->push($createBox);
        }

        $actions = FieldList::create();
        if ($canCreate || $showSelect) {
            $actions->push(
                AddToCampaignHandler_FormAction::create()
                    ->setTitle(_t(__CLASS__ . '.AddToCampaignAddAction', 'Add'))
                    ->addExtraClass('add-to-campaign__action')
            );
        }

        $form = Form::create(
            $this->controller,
            $this->name,
            $fields,
            $actions,
            AddToCampaignValidator::create()
        );

        $form->setHTMLID('Form_EditForm_AddToCampaign');
        $form->addExtraClass('form--no-dividers add-to-campaign__form');

        return $form;
    }
524987
protected function prepareParams($object, &$params)
    {
        $properties = get_object_vars($object);
        foreach ($properties as $p => $v) {
            if (is_scalar($v)) {
                $params[substr($p, 1)] = $v;
            }
        }
    }
1097412
public function save($object, $flush = true)
    {
        $this->isExpectedObject($object);
        $this->objectManager->persist($object);
        if ($flush) {
            $this->flush();
        }
    }
965938
public function invokeBeforeSubmitCallbacks(ITypedObject $object, array $input)
    {
        foreach ($this->beforeSubmitCallbacks as $callback) {
            $callback($object, $input);
        }
    }
544893
private function publishContentObjects(TreeObject $object)
    {
        $last = $this->objectService->createOrUpdate($object->data);

        foreach ($object->getNodes() as $subObject) {
            if ($subObject instanceof TreeObject) {
                $this->publishContentObjects($subObject);
            } else {
                /* @var ContentObject $subObject */
                $subObject->addParentLocation($last->getProperty('content_info')->mainLocationId);
                $this->objectService->createOrUpdate($subObject);
            }
        }
    }
1314277
public static function setValue( $object, $config )
	{
		$show		= self::getConfigValue( $config, 'value.show' );
		$weight		= self::getConfigValue( $config, 'value.weight' );
		$fillColor	= self::getConfigValue( $config, 'value.fill.color' );
		$object->value->show( (bool) $show );
		if( $show )
			self::setFont( $object, $config );
	}
607601
public function invokeOnSubmitCallbacks(ITypedObject $object, array $input)
    {
        foreach ($this->onSubmitCallbacks as $callback) {
            $callback($object, $input);
        }
    }
161186
public function load(IPost $post)
    {
        $this->template->set('title', $post->getTitle());
        $this->template->set('meta_title', $post->metaTitle());
        $this->template->set('meta_keywords', $post->metaKeywords());
        $this->template->set('meta_description', $post->metaDescription());
    }
713539
public function offsetSet($offset, $object)
    {
        if (is_int($offset) && $offset >= 0 && $offset < $this->count()) {
            $member = static::checkMember($object);
            # TODO: merge if duplicated
            if (!$this->contains($member)) {
                $this->members[$offset] = $member;
            }
        } elseif (is_null($object)) {
            $this->closed = false;
        } else {
            $this->append($object);
        }
    }
1262865
public function updateLevelForChildrenElements($object)
    {

        $tmp = new \Doctrine\Common\Collections\ArrayCollection();

        $children = $this->findChildrenByParentId($object->getId());

        foreach ($children as $ch) {
            $tmp->add($ch);
        }

        while (!$tmp->isEmpty()) {
            $d = $tmp->first();
            $tmp->removeElement($d);
            $children = $d->getChildren();
            foreach ($children as $ch) {
                $tmp->add($ch);
            }
            $parent = $d->getParent();
            $d->setLevel($parent->getLevel() + 1);
            $this->updateWithoutPreAndPostUpdate($d);
        }

    }
780810
static function addInstance($object){
		$name = str_replace(DS,'.',get_class($object));
		self::$instance[$name] = $object;
	}
562246
public void add(@NonNull final T object) {
        synchronized (mLock) {
            final int position = getItemCount();
            mObjects.add(object);
            notifyItemInserted(position);
        }
    }
1018343
public function addItemAfter(mixed $object, string $previous_key, ?string $key = null) : void
    {
        // If the previous key doesn't exist, just add the item to the end.
        if (!isset($this->members[$previous_key])) {
            $this->addItem($object, $key);
            return;
        }
        $position = array_search($previous_key, array_keys($this->members));
        $this->array_insert($object, $key, $position + 1);
    }
259647
public function loadFromArrayForGroups($object)
    {
        parent::loadFromArray($object);

        if (!empty($object->items)) {
            foreach($object->items AS &$item) {
                $Group = new Group();
                $Group->loadFromArray($item);

                $item = $Group;
            }
        }
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)
            ));
    }
58835
protected function persist($object)
    {
        if(!$object->getId()) {
            $object->setId($this->getNextId());
        }
        $key = $this->getHash().$object->getId();
        $content = serialize($object);
        
        $this->getFileManager()->write($key, $content, true);
    }