Questions tagged [jtable]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
5
votes
1answer
133 views

Where is class $tableClass defined?

I have very little knowledge about joomla core and PHP. In order to better handle my website, I am trying to read a small part of joomla core, when I come across this function JTable:getInstance, (...
5
votes
1answer
334 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 ...
3
votes
2answers
3k views

What does JTable's bind function do and why it is useful?

When writing a view which either edits creates a record, the model extends admin model which requires getTable() and getForm(). Now the confusion is how the loadForm() function knows the number of ...
3
votes
2answers
396 views

A foreign key field not updating as NULL

I am having a field 'leavepack_id' in a table with the below table definition CREATE TABLE IF NOT EXISTS `#__position` ( `position_id` int(11) NOT NULL AUTO_INCREMENT, `leavepack_id` int(9) ...
3
votes
2answers
633 views

JTable store() returns true but no row gets inserted

Here is the class definition class MyTable extends JTable{ public $parent_id = null; public $hits = 1; function __construct() { parent::__construct('#__mytable', 'parent_id',...
3
votes
1answer
96 views

Joomla: How to insert $jinput to JTable::store via CLI?

I got a little problem: I would like to create a form, which content is saved into 2 databases. Field1 -> #__table_1 Field2 -> #__table_2 I'm doing this by extending the save-method in my ...
3
votes
1answer
92 views

Why is there no rebuild() function call after deleting a usergroup?

Examining the class JTableUsergroup located in libraries\joomla\table\usergroup.php I found out, that the nested set is rebuilt after storing a new usergroup but not after deleting one. Is this ...
2
votes
1answer
75 views

Strange behavior with dates

I would like to store the input of the calendar-field in my JTable::store. To do so I'm doing this: Form-declaration: <field name="creationdate" type="calendar" default=...
2
votes
1answer
84 views

Working with Entities and Repositories in Joomla

If some of you use Symfony2, you should see what I'm referring to: The entity is basically an object as persisted in the database, and the repository is a class implementing methods to get it, or all, ...
2
votes
1answer
213 views

How to use look-up tables in a custom component?

I'm trying to develop my first component in Joomla 3.x. I'm new to the MVC paradigm and learning the basics of Joomla development. To start, I'm trying to develop a simple component to add and ...
2
votes
2answers
356 views

Using tags: JTable::store() returns false

I'm using tags in my components. Hm, well - I would like to use them ;-) This is my form-declaration for tags: <field name = "tags" type = "tag" ...
2
votes
1answer
168 views

JTable - How to know which fields are getting updated

I'm creating custom helpdesk ticketing component, where I need to track user activities. For e.g., If user have created the ticket, then it should get save to history table. Let's say user wants to ...
1
vote
1answer
316 views

Delete items of database via CLI

I would like to delete some items with state "trashed" via CLI. Is it possible to call the delete-method of JTable from CLI? Thanks for your help :-)
1
vote
1answer
362 views

Find user by email

How can I look up a user by email? I thought that JTable::load would do it, but it returns a weird data shape: $user = JTable::getInstance('User', 'JTable', array()); $user->load(array("email" =&...
1
vote
1answer
237 views

Joomla core table names for JTable::getInstance?

I'm building a tool to import content for various languages. It makes copies of existing items such as menus, articles, modules, etc. that have language specific content. For example, when copying an ...
1
vote
1answer
67 views

storing id using JTables

I am trying to insert the id value using JTable, however it seems like I have missed something and made the mistake while doing so. What changes do I need to make so as to get this working? Thanks in ...
1
vote
1answer
630 views

Use JTable to save frontend-data

I would like to save user-inputs (Form with multiple text-fields) from the frontend of my component using (admin-) JTable. In this case I would like to save a new comment to the database. I guess I ...
1
vote
1answer
67 views

Save JINPUT to JTable via CLI AND web-backend

I'm using a helper which is called by an Joomla-CLI-Script. In this script I would like to add items to my database using JTable::store. In the storing-process I'm checking some JINPUT-values, that ...
1
vote
1answer
376 views

Question about JTable::getInstance in libraries/joomla/table/table.php file

I was trying to read and understand some joomla core PHP code when I came across this function. It is located in libraries/joomla/table/table.php line 268. At the end of the function in line 305, it ...
1
vote
3answers
899 views

How to get the generated id after a successful INSERT query?

I would like to get the id of the last saved dataset in a JTable-Operation. At the moment I got this: // Create and populate an object. $value = new stdClass(); $value->userid = (int)$...
1
vote
1answer
20 views

Store category record using JTable instance from controller

I want to store a category record from controller by using JTable. My working code is- $table = JTable::getInstance('Category'); $data = array('id' => 0, 'parent_id' = 1, 'path' => 'demo', '...
1
vote
1answer
135 views

Save failed with the following error: Unknown column 'created' in 'field list'

As I develop the back end manage record functionality of a component, I am getting "Save failed with the following error: Unknown column 'created' in 'field list'" I built the helloworld component ...
1
vote
2answers
556 views

Load from JTable with some null values

I'm trying to load a specific row from my database table with JTable. In my case i have 3 fields which is unique. In most cases, two of these fields will be a null value, while one will always have a ...
1
vote
1answer
482 views

JTable - Access properties that does not belongs to the specified table

Suppose, I've two tables with following column: #__table1 - id, col1, col2 #__table2 - id, col3, col4 I've created JTable class in tables folder of my component: class ComponentNameTableTable1 ...
1
vote
0answers
457 views

JModelAdmin - save() method. What's the purpose of $table->newTags?

Can someone explain me why in the save method of the AdminModel class, there is the creation of a new $newTags property on the $table? How this new property is used? How is it handled later on by the ...
1
vote
1answer
68 views

Invalid parent id

We get "Invalid parent id" when saving our custom JTable ($ourTable->store(); $ourTable->getErrors();). We didn't have this problem before 3.7.3. Is this commit related? https://github.com/...
1
vote
3answers
595 views

JTable - Overriding store() method

I'm overriding store method to add "created" and "created_by" column in database. modified column is getting inserted with current date properly. But, for a new request, created and created_by columns ...
0
votes
3answers
979 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; ...
0
votes
1answer
464 views

Programmatically update Menu Item in Component

Im creating a component, where among other things, can create and update menus, and i have successfully used this answer to create a new menu item. Programmatically Add Menu Item in Component $...
0
votes
2answers
84 views

After upgrade to 3.5: return $row->id (last saved item) does not work

I would like to get the ID of an item that I recently saved using store-method. On Joomla 3.4.48 I was able to use this source: $data['userid'] = $userid; $data['title'] = $title; $...
0
votes
1answer
139 views

JTable->check() - Save failed with following reason: (with no reason)

In my component's JTable's subclass, I have overridden the check() method to perform my internal checks, when saving an item with my JModelAdmin subclass. So when saving an item, if any of those ...
0
votes
1answer
164 views

Joomla Form - Retrieve Values based on ID (Front End)

I'm using jform and joomla's core features of dealing with forms. i.e. Using XML as forms then storing it with JTable etc. My custom component has to deal with CRUD operation strictly at front-end. ...
0
votes
0answers
758 views

Create forms in Joomla custom html module for multiple tables

I would like to add a form that takes input for two tables. One table with single row insert to 1st table, and the other one, with multiple rows insert to 2nd table at the same time. I have read ...
0
votes
0answers
129 views

Component JTable ignores setDbo() and don't save row

I have component called "MyComponent" and table class called "MyComponentTableSample". In model I create instance to table: $table = JTable::getInstance('Sample', 'MyComponentTable'); then I want to ...