Commit 0e2490f8 authored by Ad Schellevis's avatar Ad Schellevis

(mvc) add delByUUID to ArrayField type

parent d148918b
......@@ -146,4 +146,21 @@ class ArrayField extends BaseField
return null;
}
/**
* search child item by UUID
* @param $uuid item uuid
* @return bool
*/
public function delByUUID($uuid)
{
foreach ($this->internalChildnodes as $nodeKey => $node) {
$nodeAttr = $node->getAttributes();
if (array_key_exists('uuid', $nodeAttr) && $nodeAttr['uuid'] == $uuid) {
unset($this->internalChildnodes[$nodeKey]);
return true;
}
}
return false;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment