Adds a status message as a literal field to the extended object.

@param string|array $textOrArray
@param string $type
@param string $icon
@param string $insertBefore

@return void
773870
public function addStatusMessage($textOrArray, $type = 'warning', $icon = 'warning', $insertBefore = 'Root')
    {
        if (!is_null($textOrArray)) {
            
            // Obtain Arguments:
            
            if (is_array($textOrArray)) {
                $text = isset($textOrArray['text']) ? $textOrArray['text'] : null;
                $type = isset($textOrArray['type']) ? $textOrArray['type'] : null;
                $icon = isset($textOrArray['icon']) ? $textOrArray['icon'] : null;
            } else {
                $text = $textOrArray;
            }
            
            // Add Literal Field:
            
            $this->owner->insertBefore(
                $insertBefore,
                LiteralField::create(
                    'StatusMessageLiteral',
                    sprintf(
                        '<p class="message status %s"><i class="fa fa-fw fa-%s"></i> %s</p>',
                        $type,
                        $icon,
                        $text
                    )
                )
            );
            
        }
    }
636509
public function adminNotice($message, $type = 'success')
    {
        MbWPActionHook::addActionCallback('admin_notices', function () use ($message, $type) {
            echo self::adminNoticeTemplate($message, $type);
        });
    }
650366
public function afterSave($insert, $changedAttributes)
    {
        parent::afterSave($insert, $changedAttributes);
        Tag::updateFrequency($this->_oldTags, $this->tags);
        PostAuthor::updateAuthors($this->id, $this->_oldAuthors, $this->authors);
    }
1068998
public function addSuccess($message, ...$text): void
    {
        $this->add(self::TYPE_SUCCESS, $message, ...$text);
    }
200179
protected function createNotification(string $title, string $message, string $type): array
    {
        if (!in_array($type, Notification::TYPES))
        {
            $allowed_types = implode(', ', Notification::TYPES);
            throw new InvalidArgumentException("Wrong notification \$type '{$type}'. Use only '{$allowed_types}' types.");
        }

        return [
            'title' => $title,
            'message' => $message,
            'type' => $type,
        ];
    }
183272
protected function notify($title, $message, $icon = null)
    {
        $icon = is_string($icon) ? $icon : $this->icon;

        $this->execute("notify-send -t 2000 -i {$icon} '{$title}' '$message'");
    }
965998
public function updateAttributeValueFromTextRepresentation(array $textRepresentation, ErrorList $warnings)
    {
        $textRepresentation = array_map('trim', $textRepresentation);
        $value = $this->getAttributeValueObject();
        if ($value === null) {
            if (implode('', $textRepresentation) !== '') {
                $value = new AddressValue();
            }
        }
        if ($value !== null) {
            /* @var AddressValue $value */
            $value->setAddress1(trim(array_shift($textRepresentation)));
            $value->setAddress2(trim(array_shift($textRepresentation)));
            $value->setAddress3(trim(array_shift($textRepresentation)));
            $value->setCity(trim(array_shift($textRepresentation)));
            $value->setStateProvince(trim(array_shift($textRepresentation)));
            $value->setCountry(trim(array_shift($textRepresentation)));
            $value->setPostalCode(trim(array_shift($textRepresentation)));

            $countryCode = (string) $value->getCountry();
            if ($countryCode !== '') {
                $cl = $this->app->make(CountryList::class);
                /* @var CountryList $cl */
                $countries = $cl->getCountries();
                if (!isset($countries[$countryCode])) {
                    $warnings->add(t('"%1$s" is not a valid Country code for the attribute with handle %2$s', $countryCode, $this->attributeKey->getAttributeKeyHandle()));
                } else {
                    $countryName = $countries[$countryCode];
                    $stateProvinceCode = $value->getStateProvince();
                    if ($stateProvinceCode !== '') {
                        $spl = $this->app->make(StatesProvincesList::class);
                        /* @var StatesProvincesList $spl */
                        $statesProvinces = $spl->getStateProvinceArray($countryCode);
                        if ($statesProvinces !== null && !isset($statesProvinces[$stateProvinceCode])) {
                            $warnings->add(t('"%1$s" is not a valid State/Province code for the Country %2$s (attribute with handle %3$s)', $stateProvinceCode, $countryName, $this->attributeKey->getAttributeKeyHandle()));
                        }
                    }
                }
            }
        }

        return $value;
    }
848926
public function beforeSave(Event $event, EntityInterface $entity, ArrayObject $options): void
    {
        // fallback to default icon
        if (!$entity->get('icon')) {
            $entity->set('icon', Configure::read('Icons.default'));
        }

        // fallback to hashtag as default url
        if (!$entity->get('url')) {
            $entity->set('url', '#');
        }
    }
865371
public function onAddedToType(TypeInterface &$type)
    {
        parent::onAddedToType($type);

        if ($this->getAddIndex()) {
            $type->addIndex(new Index($this->name));
        }

        $type->addTrait(PositionInterface::class, PositionInterfaceImplementation::class);
    }
404551
public static function insertAfter(array &$arr, $key, array $inserted): void
    {
        $offset = self::searchKey($arr, $key);
        if ($offset === null) {
            $arr += $inserted;
        } else {
            ++$offset;
            $arr = \array_slice($arr, 0, $offset, true) + $inserted + \array_slice($arr, $offset, null, true);
        }
    }
629295
private function assertElementValidationMessage($type, $element, $expectedMessage)
    {
        $element = sprintf('%s_%s', $type, str_replace(' ', '_', $element));
        Assert::true($this->updatePage->checkValidationMessageFor($element, $expectedMessage));
    }
671003
function (oRm, sUri, bMessageNotifier) {
			if (sUri == null || sUri == "") {
				var icon = new Icon({
					useIconTooltip: false
				});
				icon.addStyleClass("sapUiNotifierIcon");

				if (bMessageNotifier) {
					icon.setSrc("sap-icon://alert");
				} else {
					icon.setSrc("sap-icon://notification-2");
				}
				oRm.renderControl(icon);
				return;
			}

			oRm.write("<img alt=\"\"");
			oRm.addClass("sapUiNotifierIcon");
			oRm.writeClasses();

			oRm.writeAttributeEscaped("src", sUri);
			oRm.write("/>");
		}
1175572
protected function _prepareBeforeAfterContainer($type, $value)
    {
        $output    = null;
        $iconClass = ($type === 'before') ? 'prefix' : 'postfix';

        if ($value !== null) {
            $output = $value;
            if (is_string($output)) {
                $hasIcon = preg_match('/icon:[a-zA-Z]/', $output);
                if ($hasIcon > 0) {
                    list (, $icon) = explode(':', $output, 2);
                    $icon   = Str::low($icon);
                    $output = $this->Html->icon($icon, ['class' => $iconClass]);
                }
            }
        }

        return $output;
    }
1289608
public function addMessage($text, $type = null)
    {
        $this->set(null, new \OtherCode\FController\Components\Messages\Message($text, $type));
    }
45170
public MetadataBuilder addExecuteBefore(Class<? extends RuleProvider> type)
    {
        if (type != null)
        {
            executeBefore.add(type);
        }
        return this;
    }
1113498
public function notificationAjax(string $title, string $message, string $type = 'default', bool $send_payload = TRUE): void
    {
        if ($this->isAjax())
        {
            $this->payload->notifications[] = $this->createNotification($title, $message, $type);

            if ($send_payload === TRUE)
            {
                $this->sendPayload();
            }
        }
    }
1300100
public function beforeSave($insert)
    {
        if (!parent::beforeSave($insert)) {
            return false;
        }

        $this->setAttribute(static::dynamicColumn(), static::dynColExpression($this->_dynamicAttributes));

        return true;
    }