src/FreeFW/Core/Model.php
public function initWithJson(array $p_datas = [])
    {
        $props = $this->getProperties();
        $this->init();
        foreach ($p_datas as $name => $value) {
            foreach ($props as $prp => $property) {
                $test = $prp;
                if (array_key_exists(FFCST::PROPERTY_PUBLIC, $property)) {
                    $test = $property[FFCST::PROPERTY_PUBLIC];
                }
                if ($test == $name) {
                    $setter = 'set' . \FreeFW\Tools\PBXString::toCamelCase($name, true);
                    $this->$setter($value);
                    break;
                }
            }
        }
        return $this;
    }
public function initWithJson(array $p_datas = [])
    {
        $props = $this->getProperties();
        $this->init();
        foreach ($p_datas as $name => $value) {
            foreach ($props as $prp => $property) {
                $test = $prp;
                if (array_key_exists(FFCST::PROPERTY_PUBLIC, $property)) {
                    $test = $property[FFCST::PROPERTY_PUBLIC];
                }
                if ($test == $name) {
                    $setter = 'set' . \FreeFW\Tools\PBXString::toCamelCase($name, true);
                    $this->$setter($value);
                    break;
                }
            }
        }
        return $this;
    }
public function initWithJson ( array $ p_datas = [ ] ) { $ props = $ this -> getProperties ( ) ; $ this -> init ( ) ; foreach ( $ p_datas as $ name => $ value ) { foreach ( $ props as $ prp => $ property ) { $ test = $ prp ; if ( array_key_exists ( FFCST :: PROPERTY_PUBLIC , $ property ) ) { $ test = $ property [ FFCST :: PROPERTY_PUBLIC ] ; } if ( $ test == $ name ) { $ setter = 'set' . \ FreeFW \ Tools \ PBXString :: toCamelCase ( $ name , true ) ; $ this -> $ setter ( $ value ) ; break ; } } } return $ this ; }
Init object with datas

@param array $p_datas

@return \FreeFW\Core\Model
Init object with datas