/** * Get the order of the grahas. * * @param string $graha * @return array */ public function getOrderGraha($graha) { $result = Math::shiftArray($this->durationGraha, $graha); return $result; }
/** * Returns the list of navataras for nakshatra. Will be very useful when * choosing Muhurta. * * @param string $nakshatraKey Nakshatra key * @return array */ public static function listNakshatraNavatara($nakshatraKey) { if (!array_key_exists($nakshatraKey, self::listNakshatra())) { throw new \Jyotish\Panchanga\Exception\InvalidArgumentException("Nakshatra with the key '{$nakshatraKey}' does not exist."); } $nakshatas = Math::shiftArray(self::listNakshatra(), $nakshatraKey, true); $number = 1; $block = 1; foreach ($nakshatas as $key => $name) { $navataras[$key] = ['block' => $block, 'number' => $number, 'name' => self::$navatara[$number]]; $number++; if ($number > 9) { $block += 1; $number = 1; } } return $navataras; }
/** * Get lord of hora. * * @param int $horaNumber Number of hora * @param int $varaKey Key of vara * @return string */ public static function getLord($horaNumber, $varaKey) { $lords = Math::shiftArray(Graha::listGraha(Graha::LIST_CHESHTA), $varaKey); $lordsKeys = array_keys($lords); $numLord = Math::numberInCycle(1, $horaNumber, 7) - 1; return $lordsKeys[$numLord]; }
/** * Constructor * * @param null|array $options Options to set (optional) */ public function __construct($options = null) { parent::__construct($options); $nakshatras = Nakshatra::listNakshatra(); $this->orderNakshatra = Math::shiftArray($nakshatras, 3, true); }