Open yuri1994 opened 6 years ago
you need to write this line in place of use MetadataTrait; Inside class userlocation
@yuri1994 , "userlocation" is the name of the entity type, while "userlocations" , plural, is the endpoint by default.
The base endpoint of odata.svc will give you a list of endpoints.
@dsv4890 , real life has caught up with me, I'm currently too busy to look at your issue. Thank you for jumping in on this one.
@CyberiaResurrection, when i call base endpoint it return me `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
i gone to debug and i found pice of code where checked for classes with MetadataTrait and then expect this class to be instance of Controller class, but in case the real instance is Model class. Maybe i have missed some config but i don't know what exactly
What's your metadata returning? odata.svc/$metadata
Have you hooked the service providers up?
$metadata
`
just to tick off the obvious things first. have you migrated? what database engine are you using?
i use Firebird database engine
Migration file
`class Userlocation extends Migration { /**
@return void */ public function up() { Schema::create('userlocation',function (Blueprint $table){ $table->increments('id'); $table->integer('WORKER_ID')->unsigned(); $table->integer('location_id')->unsigned(); });
Schema::table('userlocation', function($table) {
$table->foreign('WORKER_ID')->references('id')->on('worker')->onDelete('cascade');
$table->foreign('location_id')->references('id')->on('location')->onDelete('cascade');
});
}
/**
Which class in POData project get the name table and make request to database?
Podata makes no direct requests to the database, they are passed into Podata Laravel via the laravel query provider.
In POdata laravel MetadataProvider, is responsible to for fetching the information from models that have the trait.
I have not heard of Firebird but will look into it.
is there any chance you could dump out the variable passed to the unify method in MetadataProvider?
@c-harris @CyberiaResurrection
The problem for me was the database engine. Now i change the code for Firebird engine and work well for GET requests. The new problem where is front to me is POST requests. How i can insert or update with POST request? Can anyone give me some example with POST?
i try to put \AlgoWeb\PODataLaravel\Models\MetadataTrait in my model class but after call the odata it return me <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
404
The model class is:
use AlgoWeb\PODataLaravel\Models\MetadataTrait; use Illuminate\Database\Eloquent\Model;
class userlocation extends Model { use MetadataTrait;
}
how i can resolve this issue?