/** * Adds an item from a widget * This method usually invoked from within another module services * * @param array $input * @param string $webPageId * @param string $name * @return boolean */ public function add(array $input, $webPageId, $name) { $items = $this->normalizeInput($input); foreach ($items as $item) { $item = $this->prepareItem($item, $webPageId, $name); $this->itemMapper->insert($item); } return true; }
/** * Adds an item * * @param array $input Raw input data * @return boolean */ public function add(array $input) { $this->track('A new "%s" item has been created', $input['name']); $this->itemMapper->insert(ArrayUtils::arrayWithout($input, array('max_depth'))); return true; }