zyimm/php-pojo

There is no license information available for the latest version (0.0.5) of this package.

将PHP数据转换为Java的pojo工具

Maintainers

Details

github.com/zyimm/pojo

Source

Issues

Installs: 40

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/zyimm/php-pojo

0.0.5 2024-03-06 08:45 UTC

This package is auto-updated.

Last update: 2025-10-06 12:02:44 UTC


README

安装

composer  require zyimm/php-pojo

使用示例

class DemoDto extends \Zyimm\Pojo\Pojo
{
    protected $id;
    
    protected $name;
    
    /**
     * @return mixed
     */
     public  function getId()
     {
        return $this->id;
     }
     
      public  function setId(int $id)
     {
        $this->id = $id;
     }
    
    /**
     * @return string
     */
     public  function getName():string
     {
        return $this->name;
     }
     
     public  function setName(string $name)
     {
         $this->name = $name;
     }

}


$dto = new DemoBto([
    'id' => 1
    'name' => 'name'
])

echo $dto['id']; // 1  or  $dto->getId();