public function getContentItems() { $rez = array('data' => array()); $fa = DM\Favorites::readAll(); foreach ($fa as $f) { $d = Util\toJSONArray($f['data']); $d['nid'] = $f['node_id']; $d['targetPath'] = $d['path']; $d['path'] = $d['pathText']; unset($d['pathText']); $d['isFavorite'] = true; $rez['data'][] = $d; } return $rez; }
public function delete($nodeId) { $rez = array('success' => DM\Favorites::deleteByNodeId($nodeId), 'node_id' => $nodeId); return $rez; }