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:
@@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user