1
0
mirror of https://github.com/flextype/flextype.git synced 2025-08-11 23:54:06 +02:00

Flextype Core: Entries - new method update() - added.

This commit is contained in:
Awilum
2019-02-07 16:47:33 +03:00
parent 31666b6b97
commit 7af9ab1665

View File

@@ -282,6 +282,24 @@ class Entries
}
}
/**
* Update entry
*
* @param string $entry Entry
* @param string $data Data
* @return bool
*/
public static update(string $entry, string $data) : bool
{
$entry_file = PATH['entries'] . '/' . $entry . '/entry.html';
if (Filesystem::has($entry_file)) {
return Filesystem::write($entry_file, $data);
} else {
return false;
}
}
/**
* Create entry
*