You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the application I am working on, I can fetch records in the default language without any problems, but I am unable to do so in the translated languages. A simplified PHP code looks like this:
public function index($slug=null)
{
$this->ServiceUnits = $this->fetchTable('ServiceUnits');
$serviceUnit = $this->ServiceUnits->find('slugged', slug: $slug)->first();
}
CREATE TABLE IF NOT EXISTS service_units ( id int NOT NULL AUTO_INCREMENT, title varchar(255) DEFAULT NULL, text text, slug varchar(100) DEFAULT NULL, active tinyint(1) NOT NULL DEFAULT '0', position float DEFAULT NULL,
PRIMARY KEY (id)
);
CREATE TABLE IF NOT EXISTS service_units_translations ( id int NOT NULL, locale varchar(5) NOT NULL, title varchar(255) DEFAULT NULL, text text, slug varchar(100) DEFAULT NULL,
PRIMARY KEY (id,locale)
);
How can I retrieve data from the service_units_translations table using the 'Slug' plugin?
The text was updated successfully, but these errors were encountered:
In the application I am working on, I can fetch records in the default language without any problems, but I am unable to do so in the translated languages. A simplified PHP code looks like this:
public function index($slug=null)
{
$this->ServiceUnits = $this->fetchTable('ServiceUnits');
$serviceUnit = $this->ServiceUnits->find('slugged', slug: $slug)->first();
}
CREATE TABLE IF NOT EXISTS
service_units
(id
int NOT NULL AUTO_INCREMENT,title
varchar(255) DEFAULT NULL,text
text,slug
varchar(100) DEFAULT NULL,active
tinyint(1) NOT NULL DEFAULT '0',position
float DEFAULT NULL,PRIMARY KEY (
id
));
CREATE TABLE IF NOT EXISTS
service_units_translations
(id
int NOT NULL,locale
varchar(5) NOT NULL,title
varchar(255) DEFAULT NULL,text
text,slug
varchar(100) DEFAULT NULL,PRIMARY KEY (
id
,locale
));
How can I retrieve data from the service_units_translations table using the 'Slug' plugin?
The text was updated successfully, but these errors were encountered: