Updated FML to newest version

This commit is contained in:
Jocy
2017-04-02 16:32:57 +02:00
parent 83710a9269
commit c5926aded2
21 changed files with 1425 additions and 995 deletions

View File

@ -215,15 +215,19 @@ class Dico
* Remove entries of the given id
*
* @api
* @param string $entryId Entry id that should be removed
* @param string $entryId Entry id that should be removed
* @param string $language (optional) Only remove entry from the given language
* @return static
*/
public function removeEntry($entryId)
public function removeEntry($entryId, $language = null)
{
$entryId = (string)$entryId;
foreach ($this->entries as $language => $entries) {
if (isset($this->entries[$language][$entryId])) {
unset($this->entries[$language][$entryId]);
foreach ($this->entries as $languageKey => $entries) {
if ($language && $language !== $languageKey) {
continue;
}
if (isset($this->entries[$languageKey][$entryId])) {
unset($this->entries[$languageKey][$entryId]);
}
}
return $this;
@ -245,6 +249,19 @@ class Dico
return $this;
}
/**
* Remove entries
*
* @api
* @return static
* @deprecated Use removeAllEntries()
* @see Dico::removeAllEntries()
*/
public function removeEntries()
{
return $this->removeAllEntries();
}
/**
* Remove all entries
*