Advertisement
verygoodplugins

Untitled

Jul 2nd, 2019
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.93 KB | None | 0 0
  1.     /**
  2.      * Gets all tags currently applied to the user, also update the list of available tags
  3.      *
  4.      * @access public
  5.      * @return array Tags
  6.      */
  7.  
  8.     public function get_tags( $contact_id ) {
  9.  
  10.         $this->connect();
  11.  
  12.         $result = $this->app->api( 'contact/view?id=' . $contact_id );
  13.  
  14.         return $result->tags;
  15.  
  16.     }
  17.  
  18.     /**
  19.      * Applies tags to a contact
  20.      *
  21.      * @access public
  22.      * @return bool
  23.      */
  24.  
  25.     public function apply_tags( $tags, $contact_id ) {
  26.  
  27.         $this->connect();
  28.  
  29.         $result = $this->app->api(
  30.             'contact/tag_add', array(
  31.                 'id'   => $contact_id,
  32.                 'tags' => $tags,
  33.             )
  34.         );
  35.  
  36.         return true;
  37.  
  38.     }
  39.  
  40.  
  41.     /**
  42.      * Removes tags from a contact
  43.      *
  44.      * @access public
  45.      * @return bool
  46.      */
  47.  
  48.     public function remove_tags( $tags, $contact_id ) {
  49.  
  50.         $this->connect();
  51.  
  52.         $result = $this->app->api(
  53.             'contact/tag_remove', array(
  54.                 'id'   => $contact_id,
  55.                 'tags' => $tags,
  56.             )
  57.         );
  58.  
  59.         return true;
  60.  
  61.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement