Exemple #1
0
 /**
  * Calculation of dasha.
  * 
  * @param string $type Dasha type (optional)
  * @param null|string $periodKey Key of period (optional)
  * @param null|array $options Options to set (optional)
  * @return \Jyotish\Base\Data
  */
 public function calcDasha($type = Dasha::TYPE_VIMSHOTTARI, $periodKey = 'now', array $options = null)
 {
     $Dasha = Dasha::getInstance($type, $options)->setData($this);
     $this->data[self::BLOCK_DASHA][$type] = $Dasha->getPeriods($periodKey);
     return $this;
 }
Exemple #2
0
 /**
  * Calculation of dasha.
  * 
  * @param string $type Dasha type (optional)
  * @param null|string $periodKey Key of period (optional)
  * @param null|array $options Options to set (optional)
  * @return Data
  * @throws Exception\UnderflowException
  */
 public function calcDasha($type = Dasha::TYPE_VIMSHOTTARI, $periodKey = 'now', array $options = null)
 {
     if (is_null($this->DateTime)) {
         throw new Exception\UnderflowException("DateTime is not setted.");
     }
     $Dasha = Dasha::getInstance($type, $options)->setData($this);
     $this->data[self::BLOCK_DASHA][$type] = $Dasha->getPeriods($periodKey);
     return $this;
 }