Example #1
0
 /**
  * Singleton feature.
  */
 public static function getInstance()
 {
     if (VoxbBase::$instance == NULL) {
         VoxbBase::$instance = new VoxbBase();
     }
     return VoxbBase::$instance;
 }
Example #2
0
 public function __construct($sXml = NULL)
 {
     if ($sXml) {
         $this->name = $sXml->tag;
         $this->count = $sXml->tagCount;
     }
     parent::getInstance();
 }
Example #3
0
 /**
  * You may create VoxbProfile object without parametes
  * if you for example would like to create a new user/profile.
  *
  * @param object $xml
  * @param string $crp
  */
 public function __construct($xml = NULL, $cpr = NULL)
 {
     if ($xml) {
         $this->cpr = $cpr;
         $this->fetch($xml);
     }
     parent::getInstance();
 }
Example #4
0
 public function __construct()
 {
     parent::getInstance();
     /**
      * Review is a review too.
      */
     $this->tags = new VoxbTags();
     $this->reviews = new VoxbReviewsController($this->reviewHandlers);
 }
 /**
  * Constructor as parameter gets a part of SimpleXml object received from the server.
  *
  * @param $voxbObj
  */
 public function __construct($voxbObj = NULL)
 {
     parent::getInstance();
     if ($voxbObj) {
         $this->title = (string) $voxbObj->review->reviewTitle;
         $this->text = (string) $voxbObj->review->reviewData;
         $this->authorVoxbId = (int) $voxbObj->userId;
         $this->authorName = (string) $voxbObj->userAlias->aliasName;
         $this->voxbId = intval($voxbObj->voxbIdentifier);
     }
 }
Example #6
0
 public function testUpdateTag()
 {
     $obj = VoxbBase::getInstance();
     $profile = new VoxbProfile();
     $profile->setUserId($this->users[0]);
     $profile->fetchMyData();
     // add a new tag (and keep old tags)
     $tag = new VoxbTagRecord();
     $this->assertTrue($tag->create('111111111', 'tag_new', $profile));
     $item = new VoxbItem();
     $item->fetchByFaust('111111111');
     $this->assertEquals($item->getTags()->getCount(), 5);
 }
Example #7
0
 public function tearDown()
 {
     $obj = VoxbBase::getInstance();
     // remove created users
     foreach ($this->users as $v) {
         $obj->call('deleteUser', array('userId' => $v));
     }
     $response = $obj->call('fetchData', array('fetchData' => array('objectIdentifierValue' => '111111111', 'objectIdentifierType' => 'FAUST'), 'output' => array('contentType' => 'all')));
     // fetch all voxbIdentifier
     $voxbIdentifier = array();
     if ($response->totalItemData) {
         if ($response->totalItemData->userItems) {
             foreach ($response->totalItemData->userItems as $v) {
                 $voxbIdentifier[] = intval($v->voxbIdentifier);
             }
         }
     }
     //remove user posts
     foreach ($voxbIdentifier as $v) {
         $obj->call('deleteMyData', array('voxbIdentifier' => $v));
     }
 }
Example #8
0
 public function __construct()
 {
     parent::getInstance();
     $this->position = 0;
 }
Example #9
0
 public function __construct()
 {
     parent::getInstance();
 }