public function setTelephone($telephone)
    {
        /**
         * Hack to support leading + sign
         * @see \luya\cms\models\NavItemPageBlockItem::rules()
         * @link https://github.com/luyadev/luya/pull/1815
         */
        $telephone = ltrim($telephone, '\\');

        $validator = new RegularExpressionValidator([
            'pattern' => '#^(?:0|\+[0-9]{2})[\d\- ()]+$#'
        ]);
        if ($validator->validate($telephone, $error)) {
            $this->_telephone = $telephone;
        } else {
            $this->_telephone = false;
        }
    }
public function setTelephone($telephone)
    {
        /**
         * Hack to support leading + sign
         * @see \luya\cms\models\NavItemPageBlockItem::rules()
         * @link https://github.com/luyadev/luya/pull/1815
         */
        $telephone = ltrim($telephone, '\\');

        $validator = new RegularExpressionValidator([
            'pattern' => '#^(?:0|\+[0-9]{2})[\d\- ()]+$#'
        ]);
        if ($validator->validate($telephone, $error)) {
            $this->_telephone = $telephone;
        } else {
            $this->_telephone = false;
        }
    }
public function setTelephone ( $ telephone ) { /**
         * Hack to support leading + sign
         * @see \luya\cms\models\NavItemPageBlockItem::rules()
         * @link https://github.com/luyadev/luya/pull/1815
         */ $ telephone = ltrim ( $ telephone , '\\' ) ; $ validator = new RegularExpressionValidator ( [ 'pattern' => '#^(?:0|\+[0-9]{2})[\d\- ()]+$#' ] ) ; if ( $ validator -> validate ( $ telephone , $ error ) ) { $ this -> _telephone = $ telephone ; } else { $ this -> _telephone = false ; } }
Setter method for telephone number.

If no valid telephone is provided, not value is set.

@param string|boolean $telephone The telephone number which should be used for the tel link.
Setter method for telephone number .