Blame view

app/library/App/Model/Projects.php 1.53 KB
1cc5980b   Alex Savenko   proj model testin...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
  <?php
  
  class Projects extends \Phalcon\Mvc\Model
  {
  
      /**
       *
       * @var integer
       * @Primary
       * @Column(type="integer", length=32, nullable=false)
       */
      public $id;
  
      /**
       *
       * @var string
       * @Column(type="string", length=255, nullable=true)
       */
      public $name;
  
      /**
       *
       * @var integer
       * @Column(type="integer", length=32, nullable=true)
       */
      public $user_id;
  
      /**
       *
       * @var string
       * @Column(type="string", nullable=true)
       */
      public $created_at;
  
      /**
       *
       * @var string
       * @Column(type="string", nullable=true)
       */
      public $updated_at;
  
      /**
       * Initialize method for model.
       */
      public function initialize()
      {
          $this->setSchema("public");
          $this->belongsTo('user_id', '\User', 'id', ['alias' => 'User']);
      }
  
      /**
       * Returns table name mapped in the model.
       *
       * @return string
       */
      public function getSource()
      {
          return 'projects';
      }
  
      /**
       * Allows to query a set of records that match the specified conditions
       *
       * @param mixed $parameters
       * @return Projects[]|Projects
       */
      public static function find($parameters = null)
      {
          return parent::find($parameters);
      }
  
      /**
       * Allows to query the first record that match the specified conditions
       *
       * @param mixed $parameters
       * @return Projects
       */
      public static function findFirst($parameters = null)
      {
          return parent::findFirst($parameters);
      }
  
  }