Questions tagged [model]

For questions regarding Models used in software to manage the data, logic and rules of the application.

8 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
1
vote
0answers
13 views

Getting allready created component model instance in a module (singleton)

I have a module, that does some stuff and needs the data from the list model of my component. Everything is coded in MVC pattern using the Joomla framework. When clicking on a menu item the list model ...
1
vote
0answers
61 views

Joomla 4: ID state of last saved row not available via $this->getState($this->getName() . '.id')

So i have a strange effect when trying moving a MVC component of mine to Joomla 4. I could break it down to a very simple test. If you look at the \libraries\src\MVC\Model\AdminModel.php file around ...
1
vote
0answers
43 views

$mymodel->publish($id, $state) returns "false" when calling it via CLI - on Web it returns true

I got a little problem: I would like to publish an item with some "different" states (1,0,2,-2,-1). I'm doing this this way: if(empty($this->getErrors())) { $tableitem->store(); $...
1
vote
0answers
588 views

K2—load Items and Categories by ID

I am about to write a little plugin for K2 what enables the user to link Items/categories to items/categories. The backend part is working and I would like to load the items/categories in public ...
0
votes
2answers
53 views

Run model function in view file to insert default value into sql

I am new to Joomla and received a half-done component. It is a mostly database-dependent component. The component consists of a SQL file that inserts all the data and is able to display it. I am ...
0
votes
1answer
41 views

Change boolean field in JModelList table like "published"

Joomla 3.9.10. I have custom component. In admin panel I show items list from one DB table with JModelList. models/mycom.php: class MyComModelMyCom extends JModelList { public function getItems()...
0
votes
0answers
969 views

Model/Controller: get id of current item and use it in controller

I got a view in my component's frontend, which catches data from model using the ID of the element: protected function populateState($ordering = null, $direction = null) { $app = ...