Jackalope\Property::getLength PHP Method

getLength() public method

{@inheritDoc}
public getLength ( )
    public function getLength()
    {
        $this->checkState();
        if (PropertyType::BINARY === $this->type) {
            return $this->length;
        }
        $vals = $this->isMultiple ? $this->value : array($this->value);
        $ret = array();
        foreach ($vals as $value) {
            try {
                $ret[] = strlen($this->valueConverter->convertType($value, PropertyType::STRING, $this->type));
            } catch (Exception $e) {
                // @codeCoverageIgnoreStart
                $ret[] = -1;
                // @codeCoverageIgnoreEnd
            }
        }
        return $this->isMultiple ? $ret : $ret[0];
    }