public function add($name, $sid = NULL) {
  $user = new User;
  if (!$user->isAdmin($sid)) throw new \JohnVanOrange\Core\Exception\NotAllowed('Must be an admin to access method', 401);
  if (strlen($name) < 1 OR $name == NULL) throw new \Exception('Tag name cannot be empty');
  $tag = htmlspecialchars(trim(stripslashes($name)));
  $slug = $this->text2slug($tag);
  if ($slug == '') throw new \Exception('Invalid tag name', 1030);

  $res = new \JohnVanOrange\Core\Resource('bl', $sid);
  $res->setValue($slug);
  $res->add();

  return [
   'message' => 'Tag added to blacklist',
  ];
 }
public function add($name, $sid = NULL) {
  $user = new User;
  if (!$user->isAdmin($sid)) throw new \JohnVanOrange\Core\Exception\NotAllowed('Must be an admin to access method', 401);
  if (strlen($name) < 1 OR $name == NULL) throw new \Exception('Tag name cannot be empty');
  $tag = htmlspecialchars(trim(stripslashes($name)));
  $slug = $this->text2slug($tag);
  if ($slug == '') throw new \Exception('Invalid tag name', 1030);

  $res = new \JohnVanOrange\Core\Resource('bl', $sid);
  $res->setValue($slug);
  $res->add();

  return [
   'message' => 'Tag added to blacklist',
  ];
 }
public function add ( $ name , $ sid = NULL ) { $ user = new User ; if ( ! $ user -> isAdmin ( $ sid ) ) throw new \ JohnVanOrange \ Core \ Exception \ NotAllowed ( 'Must be an admin to access method' , 401 ) ; if ( strlen ( $ name ) < 1 OR $ name == NULL ) throw new \ Exception ( 'Tag name cannot be empty' ) ; $ tag = htmlspecialchars ( trim ( stripslashes ( $ name ) ) ) ; $ slug = $ this -> text2slug ( $ tag ) ; if ( $ slug == '' ) throw new \ Exception ( 'Invalid tag name' , 1030 ) ; $ res = new \ JohnVanOrange \ Core \ Resource ( 'bl' , $ sid ) ; $ res -> setValue ( $ slug ) ; $ res -> add ( ) ; return [ 'message' => 'Tag added to blacklist' , ] ; }
Add to blacklist

Add tag name to blacklist. Must be admin to access.

@param string $name The tag value to be added to the blacklist.
@param string $sid Session ID that is provided when logged in. This is also set as a cookie.

@return array
Add to blacklist