Issues (5)

examples/Upload.php (1 issue)

Labels
Severity
1
<?php
2
3
require __DIR__.'/../vendor/autoload.php';
4
require __DIR__.'/config.php';
5
require __DIR__.'/Models/User.php';
6
7
/* NOTE: in case of error an exception is thrown */
8
9
use HnrAzevedo\Datamanager\DatamanagerException;
10
use Model\User;
0 ignored issues
show
The type Model\User was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
11
12
try{
13
    $entity = new User();
14
15
    $user = $entity->find()->execute()->first();
16
17
    /* Change info to update */
18
    $user->name = 'Other Name';
19
    $user->email = '[email protected]';
20
21
    /* Upload by primary key from the uploaded entity */
22
    /* If the changed information is a primary key or a foreign key it will be ignored in the update */
23
    /* NOTE: Must already have the Model returned from a query */
24
    $user->save();
25
26
}catch(DatamanagerException $er){
27
28
    die("Code Error: {$er->getCode()}, Line: {$er->getLine()}, File: {$er->getFile()}, Message: {$er->getMessage()}.");
29
30
}