PHP code example of lazyjsonmapper / lazyjsonmapper

1. Go to this page and download the library: Download lazyjsonmapper/lazyjsonmapper library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

lazyjsonmapper / lazyjsonmapper example snippets


    public function getFoo()
    {
        // try to read property, and handle a special "current_time" value.
        $value = $this->_getProperty('foo');
        if ($value === 'current_time') { return time(); }
        return $value;
    }
    public function setFoo(
        $value)
    {
        // if they try to set value to "md5", we use a special value instead
        if ($value === 'md5') { $value = md5(time()); }
        return $this->_setProperty('foo', $value);
    }