| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161 |
- <?php
- namespace MGProvision\Proxmox\v2\models;
- class Features extends AbstractObject
- {
- const ID = 'features';
- private $keyctl;
- private $nesting;
- private $mount;
- private $fuse;
- private $mknod;
- /**
- * Features constructor.
- */
- public function __construct($config=null)
- {
- if ($config) {
- $config = self::asArray($config);
- $this->setAttributes($config);
- }
- }
- /**
- * @param mixed $keyctl
- * @return Features
- */
- public function setKeyctl($keyctl)
- {
- $this->keyctl = $keyctl;
- return $this;
- }
- /**
- * @param mixed $nesting
- * @return Features
- */
- public function setNesting($nesting)
- {
- $this->nesting = $nesting;
- return $this;
- }
- /**
- * @param mixed $mount
- * @return Features
- */
- public function setMount($mount)
- {
- $this->mount = $mount;
- return $this;
- }
- /**
- * @param mixed $fuse
- * @return Features
- */
- public function setFuse($fuse)
- {
- $this->fuse = $fuse;
- return $this;
- }
- /**
- * @param mixed $mknod
- * @return Features
- */
- public function setMknod($mknod)
- {
- $this->mknod = $mknod;
- return $this;
- }
- /**
- * @return mixed
- */
- public function getKeyctl()
- {
- return $this->keyctl;
- }
- /**
- * @return mixed
- */
- public function getNesting()
- {
- return $this->nesting;
- }
- /**
- * @return mixed
- */
- public function getMount()
- {
- return $this->mount;
- }
- /**
- * @return mixed
- */
- public function getFuse()
- {
- return $this->fuse;
- }
- /**
- * @return mixed
- */
- public function getMknod()
- {
- return $this->mknod;
- }
- public function addNfs(){
- if(is_null($this->mount)){
- $this->mount = 'nfs';
- }else if(!preg_match("/nfs/", $this->mount)){
- $this->mount .= ';nfs';
- }
- return $this;
- }
- public function addCifs(){
- if(is_null($this->mount)){
- $this->mount = 'cifs';
- }else if(!preg_match("/cifs/", $this->mount)){
- $this->mount .= ';cifs';
- }
- return $this;
- }
- public function isEmpty(){
- return is_null($this->keyctl) && is_null($this->nesting) && is_null($this->mount) &&
- is_null($this->fuse) && is_null($this->mknod);
- }
- public function asConfig(){
- $filable=[];
- if($this->keyctl){
- $filable[] = 'keyctl';
- }
- if($this->nesting){
- $filable[] = 'nesting';
- }
- if($this->mount){
- $filable[] = 'mount';
- }
- if($this->fuse){
- $filable[] = 'fuse';
- }
- if($this->mknod){
- $filable[] = 'mknod';
- }
- $config = [];
- $this->toConfig($filable, $config);
- return implode(",", $config);
- }
- }
|