public function getProperty($name)
    {
        $propertiesNames = [
            "divisibility"  => 0,
            "initialSupply" => 1,
            "supplyMutable" => 2,
            "transferable"  => 3,
        ];

        if (! array_key_exists($name, $propertiesNames)) {
            throw new InvalidArgumentException("Mosaic property name '" . $name ."' is invalid. Must be one of 'divisibility', "
                                             . "'initialSupply', 'supplyMutable' or 'transferable'.");
        }

        // sort properties lexicographically (see toDTO() overload)
        $sorted = $this->sortBy("name");
        $index = $propertiesNames[$name];
        $prop  = $sorted->get($index);

        if ($prop instanceof MosaicProperty) {
            return $prop->value;
        }

        return $prop["value"];
    }
public function getProperty($name)
    {
        $propertiesNames = [
            "divisibility"  => 0,
            "initialSupply" => 1,
            "supplyMutable" => 2,
            "transferable"  => 3,
        ];

        if (! array_key_exists($name, $propertiesNames)) {
            throw new InvalidArgumentException("Mosaic property name '" . $name ."' is invalid. Must be one of 'divisibility', "
                                             . "'initialSupply', 'supplyMutable' or 'transferable'.");
        }

        // sort properties lexicographically (see toDTO() overload)
        $sorted = $this->sortBy("name");
        $index = $propertiesNames[$name];
        $prop  = $sorted->get($index);

        if ($prop instanceof MosaicProperty) {
            return $prop->value;
        }

        return $prop["value"];
    }
public function getProperty ( $ name ) { $ propertiesNames = [ "divisibility" => 0 , "initialSupply" => 1 , "supplyMutable" => 2 , "transferable" => 3 , ] ; if ( ! array_key_exists ( $ name , $ propertiesNames ) ) { throw new InvalidArgumentException ( "Mosaic property name '" . $ name . "' is invalid. Must be one of 'divisibility', " . "'initialSupply', 'supplyMutable' or 'transferable'." ) ; } // sort properties lexicographically (see toDTO() overload) $ sorted = $ this -> sortBy ( "name" ) ; $ index = $ propertiesNames [ $ name ] ; $ prop = $ sorted -> get ( $ index ) ; if ( $ prop instanceof MosaicProperty ) { return $ prop -> value ; } return $ prop [ "value" ] ; }
Helper to read a given `name` mosaic property name.

@param   string  $name       Mosaic property name.
@return  integer|boolean
Helper to read a given name mosaic property name .