/**
  * Adds updating custom fields to base object update.
  *
  * @see kyObjectBase::update()
  */
 public function update()
 {
     parent::update();
     if (!$this->isNew()) {
         $this->updateCustomFields();
     }
 }
Exemple #2
0
 /**
  * Fetches all users.
  * Optionaly you can get segment of user objects by defining starting user identifier and maximum items count.
  *
  * @param int $starting_user_id Optional starting user identifier.
  * @param int $max_items Optional maximum items count. Defaults to 1000 when starting user is defined.
  * @return kyResultSet
  */
 public static function getAll($starting_user_id = null, $max_items = null)
 {
     $search_parameters = array('Filter');
     if (is_numeric($starting_user_id) && $starting_user_id > 0) {
         if (!is_numeric($max_items) || $max_items <= 0) {
             $limit = 1000;
         }
         $search_parameters[] = $starting_user_id;
         $search_parameters[] = $max_items;
     }
     return parent::getAll($search_parameters);
 }
 /**
  * Default constructor.
  *
  * @param kyCustomFieldGroupBase $custom_field_group Custom field group this field belongs to.
  * @param array $data Object data from XML response converted into array.
  */
 function __construct($custom_field_group, $data = null)
 {
     parent::__construct($data);
     $this->custom_field_group = $custom_field_group;
 }
 public static function getAll($category = null, $max_items = null, $starting_kbarticle_id = null)
 {
     if ($category instanceof kyKnowledgebaseCategory) {
         $category_id = $category->getId();
     } else {
         $category_id = $category;
     }
     if (!is_numeric($category)) {
         return parent::getAll();
     } else {
         $search_parameters = array('ListAll', $category_id);
         if (is_numeric($starting_kbarticle_id) && $starting_kbarticle_id > 0) {
             if (!is_numeric($max_items) || $max_items <= 0) {
                 $max_items = 1000;
             }
             $search_parameters[] = $max_items;
             $search_parameters[] = $starting_kbarticle_id;
         }
         return parent::getAll($search_parameters);
     }
 }
 /**
  * Returns ticket post.
  *
  * @param int $ticket_id Ticket identifier.
  * @param int $id Ticket post identifier.
  * @return kyTicketPost
  */
 public static function get($ticket_id, $id)
 {
     return parent::get(array($ticket_id, $id));
 }
Exemple #6
0
 public function create()
 {
     if ($this->getType() !== self::TYPE_TICKET) {
         throw new BadMethodCallException('You can create only note of type "ticket"');
     }
     parent::create();
 }
 /**
  * Fetches field definitions from server.
  * Caches the result - call kyCustomFieldDefinition::clearCache() to clear the cache.
  *
  * @param array $search_parameters Optional. Additional search parameters.
  * @return kyResultSet
  */
 public static function getAll($search_parameters = array())
 {
     if (self::$definitions === null) {
         self::$definitions = parent::getAll($search_parameters);
     }
     return self::$definitions;
 }
 /**
  * Returns TroubleshooterStep attachment.
  *
  * @param int $troubelshooter_step_id TroubleshooterStep identifier.
  * @param int $id TroubleshooterStep attachment identifier.
  * @return kyTroubleshooterAttachment
  */
 public static function get($troubelshooter_step_id, $id)
 {
     return parent::get(array($troubelshooter_step_id, $id));
 }
 /**
  * Returns all categories of knowledgebase.
  *
  * @param int $starting_kbcategory_id Optional starting kbcategoryid identifier.
  * @param int $max_items Optional maximum items count. Defaults to 1000 when starting kbcategoryid is defined.
  * @return kyResultSet
  */
 public static function getAll($max_items = null, $starting_kbcategory_id = 0)
 {
     $search_parameters = array('GetList');
     if (is_numeric($starting_kbcategory_id) && $starting_kbcategory_id > 0) {
         if (!is_numeric($max_items) || $max_items <= 0) {
             $max_items = 1000;
         }
         $search_parameters[] = $max_items;
         $search_parameters[] = $starting_kbcategory_id;
     }
     return parent::getAll($search_parameters);
 }
 /**
  * Returns kbarticle attachment.
  *
  * @param int $kbarticle_id kbarticle identifier.
  * @param int $id kbarticle attachment id identifier.
  * @return kyKnowledgebaseAttachment
  */
 public static function get($kbarticle_id, $id)
 {
     return parent::get(array($kbarticle_id, $id));
 }