$webhooks_id does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$).
This check examines a number of code elements and verifies that they conform
to the given naming conventions.
You can set conventions for local variables, abstract classes, utility classes, constant, properties,
methods, parameters, interfaces, classes, exceptions and special methods.
$apps_id does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$).
This check examines a number of code elements and verifies that they conform
to the given naming conventions.
You can set conventions for local variables, abstract classes, utility classes, constant, properties,
methods, parameters, interfaces, classes, exceptions and special methods.
$users_id does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$).
This check examines a number of code elements and verifies that they conform
to the given naming conventions.
You can set conventions for local variables, abstract classes, utility classes, constant, properties,
methods, parameters, interfaces, classes, exceptions and special methods.
$companies_id does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$).
This check examines a number of code elements and verifies that they conform
to the given naming conventions.
You can set conventions for local variables, abstract classes, utility classes, constant, properties,
methods, parameters, interfaces, classes, exceptions and special methods.
$is_deleted does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$).
This check examines a number of code elements and verifies that they conform
to the given naming conventions.
You can set conventions for local variables, abstract classes, utility classes, constant, properties,
methods, parameters, interfaces, classes, exceptions and special methods.
$created_at does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$).
This check examines a number of code elements and verifies that they conform
to the given naming conventions.
You can set conventions for local variables, abstract classes, utility classes, constant, properties,
methods, parameters, interfaces, classes, exceptions and special methods.
$updated_at does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$).
This check examines a number of code elements and verifies that they conform
to the given naming conventions.
You can set conventions for local variables, abstract classes, utility classes, constant, properties,
methods, parameters, interfaces, classes, exceptions and special methods.
Loading history...
77
78
/**
79
* Initialize method for model.
80
*/
81
public function initialize()
82
{
83
$this->setSource('user_webhooks');
84
85
$this->belongsTo(
86
'webhooks_id',
87
'Canvas\Models\Webhooks',
88
'id',
89
['alias' => 'webhook']
90
);
91
92
$this->belongsTo(
93
'users_id',
94
'Canvas\Models\Users',
95
'id',
96
['alias' => 'user']
97
);
98
99
$this->belongsTo(
100
'companies_id',
101
'Canvas\Models\Companies',
102
'id',
103
['alias' => 'company']
104
);
105
106
$this->belongsTo(
107
'apps_id',
108
'Canvas\Models\Apps',
109
'id',
110
['alias' => 'app']
111
);
112
}
113
114
/**
115
* Returns table name mapped in the model.
116
*
117
* @return string
118
*/
119
public function getSource(): string
120
{
121
return 'user_webhooks';
122
}
123
124
/**
125
* Validate input data.
126
*
127
* @return void
128
*/
129
public function validation()
130
{
131
$validator = new Validation();
132
133
$validator->add(
134
'url',
135
new Url(
136
[
137
'message' => 'This Url is not valid',
138
]
139
)
140
);
141
142
return $this->validate($validator);
143
}
144
145
/**
146
* Get element by Id.
147
*
148
* @return Webhooks
149
*/
150
public static function getById($id): self
151
{
152
return self::findFirstOrFail([
153
'conditions' => 'webhooks_id = ?0 AND apps_id = ?1 AND companies_id = ?2',
This check examines a number of code elements and verifies that they conform to the given naming conventions.
You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.