1
0
mirror of https://github.com/flextype/flextype.git synced 2025-08-12 08:04:05 +02:00

Flextype Core: Entries - new methods added

- new method updateCurrentEntryField()
- new method updateCurrentEntry()
This commit is contained in:
Awilum
2019-01-19 13:51:25 +03:00
parent b3f7882f9c
commit 0c213ec10e

View File

@@ -131,14 +131,28 @@ class Entries
/**
* Update current entry
*
* Entries::updateCurrentPage('title', 'New entry title');
* Entries::updateCurrentEntry(['title' => "New Title"]);
*
* @access public
* @param array $data Data
* @return void
*/
public static function updateCurrentEntry(array $data) : void
{
Entries::$entry = $data;
}
/**
* Update current entry field
*
* Entries::updateCurrentEntryField('title', "New Title");
*
* @access public
* @param string $path Array path
* @param mixed $value Value to set
* @return void
*/
public static function updateCurrentEntry(string $path, $value) : void
public static function updateCurrentEntryField(string $path, $value) : void
{
Arr::set(Entries::$entry, $path, $value);
}