/**
  * Allows you to add an annotation object and Annotation content associated with Kaltura object
  * 
  * @action add
  * @param KalturaAnnotation $annotation
  * @return KalturaAnnotation
  */
 function addAction(KalturaAnnotation $annotation)
 {
     kalturalog::debug("annotation service addAction");
     $annotation->validatePropertyNotNull("entryId");
     $annotation->validateParentId($annotation);
     $annotation->validateEntryId($annotation);
     $annotation->validateStartTime($annotation);
     $annotation->validateEndTime($annotation);
     if ($annotation->text != null) {
         $annotation->validatePropertyMaxLength("text", AnnotationPeer::MAX_ANNOTATION_TEXT);
     }
     if ($annotation->tags != null) {
         $annotation->validatePropertyMaxLength("tags", AnnotationPeer::MAX_ANNOTATION_TAGS);
     }
     $dbAnnotation = $annotation->toInsertableObject();
     $dbAnnotation->setId($dbAnnotation->getUniqueAnnotationId());
     $dbAnnotation->setPartnerId($this->getPartnerId());
     $dbAnnotation->setStatus(AnnotationStatus::ANNOTATION_STATUS_READY);
     $dbAnnotation->setKuserId($this->getKuser()->getId());
     $dbAnnotation->setType(AnnotationType::ANNOTATION);
     $created = $dbAnnotation->save();
     if (!$created) {
         return null;
     }
     $annotation = new KalturaAnnotation();
     $annotation->fromObject($dbAnnotation);
     return $annotation;
 }