Пример #1
0
 /**
  * Returns an array of hemming grahas.
  * 
  * @return array
  */
 public function isHemmed()
 {
     $isHemmed = [];
     $p = 'prev';
     $n = 'next';
     ${$p} = Math::numberPrev($this->objectRashi);
     ${$n} = Math::numberNext($this->objectRashi);
     foreach (Graha::$graha as $key => $name) {
         if ($key == $this->objectKey) {
             continue;
         }
         if ($this->getEnvironment()['graha'][$key]['rashi'] == ${$n}) {
             $isHemmed[$key] = $n;
         } elseif ($this->getEnvironment()['graha'][$key]['rashi'] == ${$p}) {
             $isHemmed[$key] = $p;
         }
     }
     if (!(array_search($p, $isHemmed) && array_search($n, $isHemmed))) {
         $isHemmed = [];
     }
     return $isHemmed;
 }