Questions tagged [jmodel]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
17 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()...
5
votes
1answer
343 views

Why does Joomla have both models and tables?

In classic MVC, you have models that loosely corresponds to the underlying database tables. Why would Joomla need both models and tables? Edit Some quotes from provided links: In summary, the ...
1
vote
1answer
303 views

Problems with ajax call in component

I am developing a joomla component. I added a drag and drop uploader with ajax. When a file is uploaded, a confirmation-mail should be sent. I get the right item of the database with $id = $app->...
1
vote
1answer
1k views

Form-Validation in Frontend

I'm trying to get my component ready for frontend-action. There are some forms that are filled by the user - but of course I have some fields that need specific values (int, float, ...) and some ...
0
votes
0answers
761 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 = ...
0
votes
1answer
467 views

Insert value to custom field using getForm (setFieldAttribute)

I would like to add some data to a form field I declared in my forms.xml. This form field is a custom form field which is declared like this: <fields name = "userdata"> <fieldset name = "...
1
vote
0answers
39 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(); $...
0
votes
1answer
2k views

JModelLegacy $model->setState('list.limit', 6); not limit list

Am using JModelLegacy to get records , everthing works fine . however when setting limit with $model->setState('list.limit', 6); its not limiting the records below is my code : $model = ...
1
vote
1answer
2k views

Jmodel get articles of an attribute

I'd like to get articles of a certain attribute, how do I achieve it. Below is a code I get to get an article of an id: jimport('joomla.application.component.model'); JModel::addIncludePath(...
2
votes
1answer
384 views

getListQuery: Get values from another method

I would like to extend my getListQuery-method. At the moment I choose data from mysql like this: $query->select(*); $query->from('`#__hero_invoices` AS a'); // Join over the invoice-data $...
1
vote
2answers
461 views

Model should load data from another table and create associative array

I would like to extend my learning-component that I'm writing. For this reason I'm creating a little ticketing-system which fetches mail from IMAP and saves attachments if they have a specific ...
0
votes
3answers
1k views

Store data to other table and get the id

I'm using a method to store information in another table. This is how I'm doing that: public static function CreateMail($userid, $title, $state = 1) { $maildata['userid'] = $userid; ...
1
vote
1answer
109 views

Get installation-date of Joomla and/or of a component?

I would like to get the installation-date of my joomla-installation and/or of any component by writing a new method in a model of my component. How could I solve this?
4
votes
2answers
438 views

Join an existing table with a generated table of dates and count rows for each date?

I would like to use this complex mysql query in my joomla model to generate a timeline and count entries within a specific date range. My SQL Query is: SELECT T.calendar, COUNT(DATE(M.date)) as ...
1
vote
1answer
369 views

Structure to define filter_fields in JmodelList.?

when we extends JmodelList for handling list of data in our List_Model in construct function we define filter_fields in config array like $config[filter_fields]=array('field1','a.field1','field2','a....
5
votes
2answers
2k views

How can I can get the new record ID after saving data with JModel?

We need to create a new usergroup for the installation of our component, and the below code saves the data just as expected. However, retrieving the ID of the Usergroup for later use "isn't working". ...