LazyRecord\BaseModel::toYaml PHP Method

toYaml() public method

Return YAML format data.
public toYaml ( ) : string
return string YAML string
    public function toYaml()
    {
        self::$yamlExtension = extension_loaded('yaml');
        if (self::$yamlExtension) {
            return yaml_emit($this->_data, YAML_UTF8_ENCODING);
        }
        return file_put_contents($yamlFile, "---\n" . Yaml::dump($this->_data, $inline = true, $exceptionOnInvalidType = true));
    }