Exemple #1
0
 /**
  * Serialize config to JSON
  *
  * @return array
  */
 public function jsonSerialize()
 {
     $result = [];
     if (!is_null($this->id)) {
         $result['id'] = $this->id;
     }
     $result['mountPoint'] = $this->mountPoint;
     $result['backend'] = $this->backend->getIdentifier();
     $result['authMechanism'] = $this->authMechanism->getIdentifier();
     $result['backendOptions'] = $this->backendOptions;
     if (!is_null($this->priority)) {
         $result['priority'] = $this->priority;
     }
     if (!empty($this->applicableUsers)) {
         $result['applicableUsers'] = $this->applicableUsers;
     }
     if (!empty($this->applicableGroups)) {
         $result['applicableGroups'] = $this->applicableGroups;
     }
     if (!empty($this->mountOptions)) {
         $result['mountOptions'] = $this->mountOptions;
     }
     if (!is_null($this->status)) {
         $result['status'] = $this->status;
     }
     if (!is_null($this->statusMessage)) {
         $result['statusMessage'] = $this->statusMessage;
     }
     return $result;
 }
 /**
  * Serialize config to JSON
  *
  * @return array
  */
 public function jsonSerialize()
 {
     $result = [];
     if (!is_null($this->id)) {
         $result['id'] = $this->id;
     }
     $result['mountPoint'] = $this->mountPoint;
     $result['backend'] = $this->backend->getIdentifier();
     $result['authMechanism'] = $this->authMechanism->getIdentifier();
     $result['backendOptions'] = $this->backendOptions;
     if (!is_null($this->priority)) {
         $result['priority'] = $this->priority;
     }
     if (!empty($this->applicableUsers)) {
         $result['applicableUsers'] = $this->applicableUsers;
     }
     if (!empty($this->applicableGroups)) {
         $result['applicableGroups'] = $this->applicableGroups;
     }
     if (!empty($this->mountOptions)) {
         $result['mountOptions'] = $this->mountOptions;
     }
     if (!is_null($this->status)) {
         $result['status'] = $this->status;
     }
     if (!is_null($this->statusMessage)) {
         $result['statusMessage'] = $this->statusMessage;
     }
     $result['userProvided'] = $this->authMechanism instanceof IUserProvided;
     $result['type'] = $this->getType() === self::MOUNT_TYPE_PERSONAl ? 'personal' : 'system';
     return $result;
 }