예제 #1
0
 /**
  * Determine if the jyotish object is affected.
  * 
  * @param null|string $feature Feature of graha (optional)
  * @param null|string $value Value of feature (optional)
  * @return bool|array
  */
 public function isAffected($feature = null, $value = null)
 {
     if (is_null($feature)) {
         $grahas = Graha::$graha;
     } else {
         $grahas = Graha::listGrahaByFeature($feature, $value);
     }
     $grahaAspected = array_intersect_key($this->isAspectedByGraha(), $grahas);
     $grahaAspected1 = array_intersect($grahaAspected, [1]);
     if (count($grahaAspected1)) {
         $isAspected = $grahaAspected1;
     } else {
         $isAspected = false;
     }
     $grahaConjuncted = array_intersect_key($this->isConjuncted(), $grahas);
     if (count($grahaConjuncted)) {
         $isConjuncted = $grahaConjuncted;
     } else {
         $isConjuncted = false;
     }
     $grahaHemmed = array_intersect_key($this->isHemmed(), $grahas);
     if (array_search('prev', $grahaHemmed) && array_search('next', $grahaHemmed)) {
         $isHemmed = $grahaHemmed;
     } else {
         $isHemmed = false;
     }
     if ($isHemmed || $isAspected || $isConjuncted) {
         return ['aspect' => $isAspected, 'conjunct' => $isConjuncted, 'hem' => $isHemmed];
     } else {
         return false;
     }
 }
예제 #2
0
 /**
  * Get deeptadi avastha of graha.
  * 
  * @return string
  * @see Maharishi Parashara. Brihat Parashara Hora Shastra. Chapter 45, Verse 8-10.
  */
 public function getAvasthaDeeptadi()
 {
     $rashiAvastha = $this->getRashiAvastha();
     $avastha = [];
     switch ($rashiAvastha) {
         case Rashi::GRAHA_UCHA:
         case Rashi::GRAHA_MOOL:
             $avastha[] = Avastha::NAME_DEEPTA;
             break;
         case Rashi::GRAHA_SWA:
             $avastha[] = Avastha::NAME_SWASTHA;
             break;
         case Rashi::GRAHA_FRIEND:
             $relation = $this->getRelation()[$this->getDispositor()];
             if ($relation == 2) {
                 $avastha[] = Avastha::NAME_PRAMUDITA;
             } else {
                 $avastha[] = Avastha::NAME_SHANTA;
             }
             break;
         case Rashi::GRAHA_NEUTRAL:
         case Rashi::GRAHA_NEECHA:
             $avastha[] = Avastha::NAME_DINA;
             break;
         case Rashi::GRAHA_ENEMY:
             $relation = $this->getRelation()[$this->getDispositor()];
             if ($relation == -2) {
                 $avastha[] = Avastha::NAME_KHALA;
             } else {
                 $avastha[] = Avastha::NAME_DUKHITA;
             }
     }
     $maleficsAll = Graha::listGrahaByFeature('character', Graha::CHARACTER_PAPA);
     $maleficsConjuncted = array_intersect_key($this->isConjuncted(), $maleficsAll);
     if (count($maleficsConjuncted)) {
         $avastha[] = Avastha::NAME_VIKALA;
     }
     if ($this->isAstangata()) {
         $avastha[] = Avastha::NAME_KOPA;
     }
     return $avastha;
 }