Skip to content
Snippets Groups Projects
Select Git revision
  • 09a0741221505b5ccdd6ce35970c11fc99fa5071
  • master default protected
2 results

Example.php

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    Example.php 426 B
    <?php
    
    namespace JsonapiExample\Models;
    
    class Example
    {
        public static $nextId = 1;
    
        public $id;
        public $title;
        public $mkdate;
    
        public function __construct($title)
        {
            $this->id = self::$nextId++;
            $this->title = $title;
            $this->mkdate = time();
        }
    
        public static function findAll()
        {
            return [new Example("foo"), new Example("bar"), new Example("baz")];
        }
    }