src/Model/ImapDir.php line 105

Open in your IDE?
  1. <?php
  2. namespace App\Model;
  3. use App\Util\Api;
  4. class ImapDir implements \JsonSerializable
  5. {
  6.     private $parent;
  7.     private $name;
  8.     private $path;
  9.     private $originalPath// original path in UTF7-imap
  10.     private $count;
  11.     private $level// level of dir in a structure (0 for children of INBOX)
  12.     
  13.     private $hasSubfolders// if this folder has subfolders
  14.     
  15.     public function __construct() {
  16.         $this->parent "";
  17.         $this->name "";
  18.         $this->path "";
  19.         $this->originalPath "";
  20.         $this->count 0;
  21.         $this->level 0;
  22.         $this->hasSubfolders null;
  23.     }
  24.     /**
  25.      * @return mixed
  26.      */
  27.     public function getOriginalPath()
  28.     {
  29.         return $this->originalPath;
  30.     }
  31.     
  32.     /**
  33.      * @param mixed $originalPath
  34.      */
  35.     public function setOriginalPath($originalPath)
  36.     {
  37.         $this->originalPath $originalPath;
  38.     }
  39.     
  40.     public function getParent(): ?string
  41.     {
  42.         return $this->parent;
  43.     }
  44.     
  45.     public function setParent(string $name): self
  46.     {
  47.         $this->parent $name;
  48.         
  49.         return $this;
  50.     }
  51.     
  52.     public function getName(): ?string
  53.     {
  54.         return $this->name;
  55.     }
  56.     
  57.     public function setName(string $name): self
  58.     {
  59.         $this->name $name;
  60.         
  61.         return $this;
  62.     }
  63.     
  64.     public function getPath()
  65.     {
  66.         return $this->path;
  67.     }
  68.     public function setPath($path)
  69.     {
  70.         $this->path $path;
  71.         
  72.         return $this;
  73.     }
  74.     public function getCount(): ?int
  75.     {
  76.         return $this->count;
  77.     }
  78.     
  79.     public function setCount(string $count): self
  80.     {
  81.         $this->count $count;
  82.         
  83.         return $this;
  84.     }
  85.     
  86.     public function getLevel(): ?int
  87.     {
  88.         return $this->level;
  89.     }
  90.     
  91.     public function setLevel(string $level): self
  92.     {
  93.         $this->level $level;
  94.         
  95.         return $this;
  96.     }
  97.     
  98.     public function jsonSerialize()
  99.     {
  100.         $vars get_object_vars($this);
  101.         return $vars;
  102.     }
  103.     
  104.     public static function cmpObjects($o1$o2)
  105.     {
  106.         if(strcasecmp($o1->getParent(), $o2->getParent()) == 0) {
  107.             return strcasecmp($o1->getName(), $o2->getName());
  108.         }
  109.         else {
  110.             return strcasecmp($o1->getParent(), $o2->getParent());
  111.         }
  112.     }
  113.     
  114.     public function hasSubfolders() : bool
  115.     {
  116.         if($this->hasSubfolders == null) {
  117.             return false;
  118.         }
  119.         
  120.         return $this->hasSubfolders;
  121.     }
  122.     
  123.     public function setHasSubfolders($val)
  124.     {
  125.         $this->hasSubfolders $val;
  126.     }
  127. }