Returns any previously flashed messages.

@param bool $clear whether to delete the flashed messages from the session
@return array set of associative arrays with message, level keys
519655
public function getFlashed($clear = true)
    {
        $messages = $this->core->session()->get(static::SESSION_FLASH_KEY, []);

        if ($clear) {
            $this->core->session()->remove(static::SESSION_FLASH_KEY);
        }

        return $messages;
    }
698246
public function delete($clear = true)
    {
        $revisions = Revision::where('content_id', $this->content->id)->get();

        $ids = $revisions->pluck('id');

        $this->getFieldTypes()->each(function ($type) use ($ids) {
            $type::whereIn('revision_id', $ids)->delete();
        });

        Revision::whereIn('id', $ids)->delete();
        $this->revision->exists = false;

        // TODO :: add an event system to be able to remove this content from entity fields

        $this->content->delete();

        if ($clear) {
            $this->revision->id = null;
            $this->content->id = null;
            $this->clearFields();
        }
    }
951931
public function getAll() {
		if ($this->hasAny()) {
			$messages = $_SESSION[self::SESSION_KEY_FLASH];

			$_SESSION[self::SESSION_KEY_FLASH] = [];

			return $messages;
		}
		else {
			return [];
		}
	}
380686
public function getFields($reset = false)
    {
        if (!$this->table) {
            return $this->fields;
        }

        if ($this->fields === null || $reset) {
            foreach ($this->getDataMapper()->getFields() as $field) {
                $this->addField($field);
            }
        }

        return $this->fields;
    }
241024
public function clear($type = null)
    {
        if (false === $this->mf->hasCache()) {
            return [];
        }
        return $this->doClear($this->getTypes($type));
    }
142066
protected function getWildcardCustomMessages($messages, $search, $default)
    {
        foreach ($messages as $key => $message) {
            if ($search === $key || (Str::contains($key, ['*']) && Str::is($key, $search))) {
                return $message;
            }
        }

        return $default;
    }
301311
private function getFiltered(bool $public = true): array
    {
        $result = [];
        foreach ($this->events as $event) {
            if ($event['is_public'] === $public) {
                $result[] = $event;
            }
        }
        return $result;
    }
58736
public function get($modified = true)
    {
        //Argument 1 must be a boolean
        Argument::i()->test(1, 'bool');

        $array = array();
        //for each row
        foreach ($this->list as $i => $row) {
            //get the array of that (recursive)
            $array[$i] = $row->get($modified);
        }

        return $array;
    }
229558
protected static function clearAttributes(array $attributes, array $clear): array
    {
        foreach ($clear as $attributeName) {
            if (array_key_exists($attributeName, $attributes)) {
                unset($attributes[$attributeName]);
            }
        }
        return $attributes;
    }
616083
public function retrieveAll($meta = false) {
    if ($meta === false) {
      $results = array();
      $cachedData = $this->_loadCache();
      if ($cachedData) {
        foreach ($cachedData as $k => $v) {
          $results[$k] = unserialize($v['data']);
        }
      }
      return $results;
    } else {
      return $this->_loadCache();
    }
  }
205813
public static function getMessages(): array
    {
        $messages = Session::get(self::FLASH_KEY, []);
        Session::forget(self::FLASH_KEY);

        return $messages;
    }
372348
public function getBind($clear = true)
    {
        $bind = $this->bind;
        if ($clear) {
            $this->bind = [];
        }

        return $bind;
    }
908505
public static function getList(bool $full = false)
    {
        $class = get_called_class();
        if (empty(self::$list[$class])) {
            self::$list[$class] = self::loadList();
        }
        
        $list = self::$list[$class];
        
        foreach ($list as $name => $sid) {
            if (static::isHidden($name)) {
                if (!$full)
                    unset($list[$name]);
                else
                    $list = self::updateHiddenValue($list, $name);
            }
        }

        return $list;
    }
353267
public function getMessagings($force = false)
    {
        if ($this->nb_messaging_list->isEmpty() || $force) {
            $this->nb_messaging_list->clear();
            $this->nb_messaging_list->merge(CNabuMessaging::getAllMessagings($this));
        }

        return $this->nb_messaging_list->getItems();
    }
161607
public function retrieveAll($raw = false)
    {
        if ($cache = $this->loadCache()) {
            if (!$raw) {
                $results = [];
                foreach ($cache as $key => $value) {
                    $results[$key] = unserialize($value['data']);
                }
                return $results;
            } else {
                return $cache;
            }
        }
        return null;
    }
734746
public function retrieve($domain)
	{
		$messages = $this->session->get($this->key($domain), array());

		if (count($messages))
		{
			$this->clear($domain);
		}

		return $messages;
	}
985526
public function output($remove = true)
    {
        $remove = (bool)$remove;
        $messages = $this->session->get($this->flashKey, [], $remove);
        if (!empty($messages)) {
            foreach ($messages as $message) {
                echo $message;
            }
        }
        if ($remove) {
            $this->clear();
        }
    }