Tagged Questions
0
votes
1answer
21 views
Codeigniter Datamapper ORM - in-table foreign key not working
For some reason Datamapper is not recognising my in-table foreign key relationship and is attempting to use a joining table instead when I try and access my related object.
It’s probably the simplest ...
2
votes
1answer
47 views
Codeigniter : How to make the nested selection for related tables
I have two tables in my database one for "LOUNGES" and one for "CITIES". There isn't an explicit connection between them. I mean I haven't put a column "city_id" in the "LOUNGES TABLE". I just take ...
0
votes
0answers
23 views
Codeigniter: Parser issue in a form. Only one is saved
I have a strange issue with one form in Codeigniter. I am also using DataMapper PHP. So I have one form with two select statements with a couple of options. If one is selected the other one becomes 0 ...
0
votes
0answers
10 views
CodeIgniter DataMapper get_iterated
Can someone please provide an explanation of the difference between get() and get_iterated() in the context of CodeIgniter's DataMapper ORM referenced here:
...
0
votes
1answer
22 views
Mysql left outer join column does not exist - CodeIgniter DataMapper ORM
I'm running the following query, which is being generated by CodeIgniter's DataMapper ORM as I try to query a deep relationship of the form order_product/order/order_status:
SELECT `order_products`.*
...
0
votes
2answers
20 views
CodeIgniter DataMapper ORM memory issue
I am using CodeIgniter and DataMapper to manage relationships for an ecommerce store. The relationships are:
A product has many skus
A product has many amazon_products
A sku has many amazon_products
...
0
votes
0answers
28 views
Joining tables using ORM Datamapper CodeIgniter
I've spent quite a few hours trying to find out a way of implementing this query:
SELECT * FROM
(SELECT * FROM bf_snippets where id IN
(
SELECT snippet_id FROM ...
0
votes
1answer
33 views
CodeIgniter DataMapper ORM not running all queries
This has been working great but recently we have come across an issue
we have not been able to figure out why it is not behaving the way it should.
The problem is that it doesn't run correct queries ...
0
votes
1answer
22 views
CodeIgniter DataMapper with Nested Sets
I'm trying to get a basic example of CodeIgniter DataMapper Nested Sets working using the included Nested Sets extension to DataMapper. I have a table set up with a single tree in it:
...
0
votes
1answer
36 views
CodeIgniter DataMapper related objects in array
I have a Product_faq class which has a $has_many relationship to a Product class. I have a Product class which has a $has_many relationship to the Product_faq class. These two classes are joined using ...
0
votes
1answer
21 views
CodeIgniter DataMapper include_related only including one related model
I have a Product_faq class which has a $has_many relationship to a Product class. I have a Product class which has a $has_many relationship to the Product_faq class. These two classes are joined ...
0
votes
0answers
26 views
Getting an Iterator over DataMapper relationships
Currently, I have a 1:n relation between Foo and Bar:
class Foo extends DataMapper {
$has_one = array('bar');
...
}
class Bar extends DataMapper {
$has_many = array('foo');
}
...
0
votes
2answers
27 views
Retrieving words from database with codeignitor
I have recently started using codeignitor and I am a bit stuck as it is all rather new to me.
I use to have a config file with database conection and this on it:
$qset = "select * from re_settings";
...
0
votes
0answers
32 views
Add Existing Objects to a Nest Set Tree in Codeigniter Datamapper
I want to use the DataMapper nested sets extension to manage the relationship of Manager -> Employee on the Users in my application. However, many users have already been created. Is there a way to ...
1
vote
2answers
42 views
Codeigniter: How to make a desc order between 3 tables?
So I am using CodeIgniter and DataMapper. I made something like a wall where you can view articles link posts image posts. This are 3 different tables and each one of them have column called ...
0
votes
2answers
24 views
Codeigniter & Datamapper: Retrive all the ID's from ID column and attach to array
I am having trouble collecting all the ids from the ID column. What the code above does is getting only one ID, at least it goes to the array but I want to take all of them.
$getArticlesId = new ...
0
votes
2answers
51 views
Codeigniter & Datamapper: Count() comments
I am having trouble counting how many comments an article has. It is one to many relationship and I have a column in the comments table called (article_id) and on my index page where are displayed all ...
2
votes
1answer
80 views
Update (save & delete) relationship without using $related->get();
I'm using codeigniter 2.1.4 & datamapper orm. I know how to save relations to an object and I know how to delete them.
In this case I have a many-to-many relation, which I want to update with new ...
0
votes
2answers
339 views
A PHP Error was encountered Severity: Notice Message: Array to string conversion Filename: mysql/mysql_driver.php Line Number: 552
Model :
function trans_gdc_add()
{
$trans_gdc_gc_package[0] = $this->input->post('trans_gdc_gc_package');
$trans_gdc_gc_package1 = implode(",", $trans_gdc_gc_package[0]);
...
0
votes
1answer
53 views
CodeIgniter & Datamapper: One to many Relationship
I am trying to make one to many relationship between lounges and cities
So, one lounge can be in many cities - "KFC" => London, Paris, Madrid and etc
For the purpose I am using DataMapper, but the ...
0
votes
1answer
83 views
How to show image from database into a dynamically created table using code igniter?
I have an image database where i upload all of my images. Now i want to show my images in my view page into a 4*4 table. that means i want to view 16 images at a time with pagination. but i face a ...
0
votes
1answer
49 views
Error Number: 1096 Error Number: 1096 No tables
class model_trans_gc extends CI_Model{
function trans_gc_add()
{
$add=array(
'trans_gc_date' => $this->input->post('trans_gc_date'),
'trans_gc_no' ...
0
votes
1answer
37 views
Proper Method For Setting Up One-to-One in CodeIgniter Datamapper
I am reviewing all of my models and corresponding tables for CodeIgniter Datamapper. I'm wondering what the correct way of setting up a one-to-one relationship with a defined parent and child is. The ...
0
votes
1answer
45 views
Pagination using codeigniter is not working
My pagination is not working. I am using codeigniter 2.1.4. I dont understand what's the problem when i run this get an error like " Undefined property: Crud::$limit". Plz help
Here is my controller:
...
0
votes
1answer
68 views
Codeigniter & Datamapper: Saving uploaded image to database doesn't work
I am trying to use datamapper to help me out and store the file_name in the database. First I did it with the basic example of do_upload given in Codeigniter manual in the end I wrote 3 lines of ...
2
votes
1answer
66 views
How Edit record using Codeigniter
I am trying to edit my db record using codeigniter but I can't do it and what's the problem I didn't understand. Please help.
Here is my controller code :
public function edit()
{
...
0
votes
1answer
54 views
Codeigniter & Datamapper: Form Saving is behaving strange
I have a weird problem with Codeigniter and Datamapper,
I am making an CMS system and I am trying to edit an article from the Database using Datamapper. When I click to edit the article I get the ...
0
votes
0answers
21 views
datamapper orm - deep relationship: show all user permissions via roles
I think I do not understand ORM (datamapper ORM) good enough but here's what I'm trying to do:
Users have multiple roles
Roles have multiple permissions
I want to get all permissions of a user. I ...
0
votes
0answers
41 views
CI Datamapper ORM complex count related
For the first time, I'm using a datamapper for a CodeIgniter project.
I have a table products, in which I store my items.
There is a table categories, that specifies the kind of item.
And a table ...
1
vote
2answers
32 views
Call variable from view in Codeigniter
I am trying to call $data['form_value'] from view in Codeigniter, but that array returns empty.
Here is my Controller:
$data['field'] = $this->cc->get_form_names($data['selid']);
...
0
votes
2answers
42 views
codeIgniter Datamapper Get Only Query Results
I want to save results to cache but datamapper result objects is huge array.
I want to get only my query results without other data that referenced codeigniter data (models/configs/languages/etc..)
...
1
vote
1answer
71 views
codeIgniter Datamapper Performance on Joins with include_related
I'm using codeIgniter 2.1.4 with Datamapper and i worry about Datamapper performance.
My results are only 2 rows and return successfully!
But when i dumped $posts with var_dump($posts), I'm getting ...
0
votes
0answers
24 views
Datamapper Related Validation Rules
I need to set up the validation rules to validate the related items on a specific object, ie: A user can have no more than 3 products related to it.
I believe DataMapper can check for this validation ...
1
vote
1answer
88 views
Codeigniter Datamapper - multilevel page navigation
I am using "DataMapper, OverZealous Edition" for my current project. I have to make multilevel sub-page navigation in my project, i.e like
Page-A
- Page-A1
- Page-A2
...
1
vote
1answer
51 views
delete multiple relationships in codeigniter datamapper orm
I have two models:
users and groups
user has many groups
and group has many users
I try to delete all groups of a user like this, which is not working
$user = new User(1);
...
0
votes
2answers
35 views
Retrieve the last user only who reviewed a post
What I am trying to do here is query the last user reviewed a business.
This is biz table
id | username | bizname | city_id
----------------------------------.......
This is review table
id | ...
0
votes
0answers
40 views
many to Many Self-Relationships in datamapper for code ignitor?
How does one do this?
I have a many to many relationship with components. I have components that can
be a parent component, in that they contain one of more other components
be a child component, ...
0
votes
1answer
42 views
Sorting Datamapper ORM results through an array
I have an issue with datamapper orm and codeigniter.
I have an array with person names:
$names = array('john t', 'alex f', 'martin a');
Now I want to get all person who have this name:
$persons = ...
0
votes
1answer
179 views
Datamapper with codeigniter save many to many relationship
I have three table company,group and company_group.
I am getting values from post while saving a company.
In my company form i have multiple select box which has a list of group.
My company is ...
0
votes
0answers
109 views
Doesnt create tables . Codeigniter DataMapper ORM
I am new to the DataMapper ORM,
i create a simeple application with Model User.
On my controller i write
$u=new User();
$u->save();
but i got eroor,
Error Number: 1146
Table ...
0
votes
3answers
409 views
How to get parameter value in controller called using redirect function in codeigniter
I have started with codeingniter, I am calling controller using redirect() function with parameter, how can I get the parameter value in controller.php?
view.php
$para array(
...
0
votes
1answer
128 views
Codeigniter WanWizard DataMapper all_to_array error?
I'm having an issue using WanWizard's DataMapper 1.8.2. I want to get an array of results after get(). The following snippet shows how I have been able to do it vs. how I want, and as far as the ...
0
votes
1answer
64 views
Codeigniter ORM unable to ceate relation
Trying to establish a simple multiple relation between two tables.
Unfortunately Codeigniter keeps saying:
"Unable to locate the model you have specified: eventtrigger".
Here comes the code:
...
0
votes
0answers
74 views
Codeigniter DataMapper - Include related id's repeating
My problem is that child object ids repeating:
I've a one to many relation:
Posts - Comments
$p = new Posts();
$p->include_related('comment', NULL, TRUE, TRUE)->get();
foreach($p as $post)
{ ...
0
votes
1answer
158 views
Datamapper with existing database- tables with primary key column name other than id
I am running a application using codeigniter framework. I have a database. I want to implement datamapper ORM. Since for datamapper- "Every table must have a primary key named id".
I have an auto ...
0
votes
1answer
48 views
Codeigniter Language error
I have added a language file named as license_lang.php.Then i called this in controller by $this->lang->load('license'); .But showing error like "Unable to load the requested language file: ...
1
vote
1answer
160 views
Codeigniter HMVC + datamapper
I'm facing a problem when I'm using datamapper with codegniter and HMVC module.
It didnt work for MX_CONTROLLER .. c
I have followed these steps: http://stensi.com/datamapper/pages/installation.html
...
0
votes
2answers
4k views
PHP Codeigniter insert delete update with submit buttons
Need help with PHP Codeigniter framework.
I have a form with 3 Submit buttons. I want to Insert - Update - Delete using those buttons. I successfully made the Insert button work. So when I click on ...
0
votes
1answer
93 views
CI Datamapper: Iterate parent child
I have categories and posts.
I would like to list all categories (parent), and all related posts (child). Without nested sets, complex queries. Relations setted up.
As i rembember from the ...
0
votes
1answer
67 views
Mapping relationships to generic models in Datamapper for Codeigniter
I have a number of different models in a system backed by the Datamapper library for Codeigniter such as Posts and Pages and am interested in adding Likes and Comments to the system. The way I see it, ...