class Model_User extends ORM {
// columns: UserID, Name
// public $Name ; // this didn't work
}
Currently I create an object:
$user = new Model_User() ;
and access columns like:
$user->Name = 'My Name';
I'd like to have my IDE show me all the columns in the data model to avoid misspellings and to now right away what fields I ca...
I have the following, for example:
class Model_User extends ORM {
protected $_rules = array(
'username' => array(
'not_empty' => NULL,
'min_length' => array(6),
'max_length' => array(250),
'regex' => array('/^[-\pL\pN_@.]++$/uD'),
),
'password' => array(
...
Hello. I have two tables:
taxonomies
-id
-name
taxonomy_type
-taxonomy_id
-type_id
I've configured two models:
class Model_Taxonomy{
protected $_has_many = array('types'=>array());
}
class Model_Taxonomy_Type{
protected $_belongs_to = array('taxonomy' => array());
}
*Please note that taxonomy_type is not a pivot table.*
A ta...
In my application i have a loop that executes about 1000 times, inside it i'm creating object and saving it. This is the part of application where i populate my database with data. In common this looks like this:
foreach(...){
...
try{
$object = new Model_Whatever;
$object->whatever=$whatever;
$object->sa...
Hi I can't seem to select data from multiple tables with kohana orm.
When I do:
$obj = orm::factory('a')
->join('b')
->on('a.b_id','=','b.id')
->select ('b.','a.')
->find_all();
The only variables available in $obj are from table a. Can someone help?
...
Hi,
I'm executing a simple query and want to get an array back.
Based on the ORM tutorial that comes with the Kohana 3 guide, I thought I could do the following:
ORM::factory('user')->find_all()->as_array();
But that seems to give me an array of model objects (ie array( User_Model1, User_Model2 ...
Looking at the source I see I can e...