public function toAll($decimals = null, $round = true)
    {
        if (!isset($this->value)) {
            throw new InvalidArgumentException('From value not set');
        }

        if (empty($this->base_unit)) {
            throw new InvalidArgumentException('No from unit set');
        }

        $units = array();

        foreach ($this->units as $key => $data) {
            if ($data['base'] == $this->base_unit) {
                array_push($units, $key);
            }
        }

        return $this->toMany($units, $decimals, $round);
    }
public function toAll($decimals = null, $round = true)
    {
        if (!isset($this->value)) {
            throw new InvalidArgumentException('From value not set');
        }

        if (empty($this->base_unit)) {
            throw new InvalidArgumentException('No from unit set');
        }

        $units = array();

        foreach ($this->units as $key => $data) {
            if ($data['base'] == $this->base_unit) {
                array_push($units, $key);
            }
        }

        return $this->toMany($units, $decimals, $round);
    }
public function toAll ( $ decimals = null , $ round = true ) { if ( ! isset ( $ this -> value ) ) { throw new InvalidArgumentException ( 'From value not set' ) ; } if ( empty ( $ this -> base_unit ) ) { throw new InvalidArgumentException ( 'No from unit set' ) ; } $ units = array ( ) ; foreach ( $ this -> units as $ key => $ data ) { if ( $ data [ 'base' ] == $ this -> base_unit ) { array_push ( $ units , $ key ) ; } } return $ this -> toMany ( $ units , $ decimals , $ round ) ; }
Convert from value to all compatible units
@param number $decimals
@param bool $round
@return array
@throws InvalidArgumentException
Convert from value to all compatible units