CodeIgniter Forums
DMZ 1.7.1 (DataMapper OverZealous Edition) - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22)
+--- Thread: DMZ 1.7.1 (DataMapper OverZealous Edition) (/showthread.php?tid=28550)



DMZ 1.7.1 (DataMapper OverZealous Edition) - El Forum - 07-24-2010

[eluser]OverZealous[/eluser]
@modano
Are you talking about the HTMLForm extension? I no longer support that extension.


DMZ 1.7.1 (DataMapper OverZealous Edition) - El Forum - 07-24-2010

[eluser]modano[/eluser]
no not at all, have a look at my initial post # 482.
It didnt work on a big form i am working on, so i made a new form that only had that one textfield, and yet it gave me the error "“The City relationship is required.”"

/modano


DMZ 1.7.1 (DataMapper OverZealous Edition) - El Forum - 07-25-2010

[eluser]WanWizard[/eluser]
@phil,

The function autoload checks hardcoded for models prefixed with CI_, EE_ or MY_. This check fails to work if you use a custom subclass prefix in your config.

I propose changing it to
Code:
$CI =& get_instance();

// Don't attempt to autoload CI_, EE_ or MY_ prefixed classes
if (in_array(substr($class, 0, 3), array('CI_', 'EE_', 'MY_')) OR strpos($class, $CI->config->item('subclass_prefix')) === 0)
{
    return;
}



DMZ 1.7.1 (DataMapper OverZealous Edition) - El Forum - 07-26-2010

[eluser]gyo[/eluser]
Hi,

I have a "conceptual" issue understanding DataMapper and login handling.
It makes sense to me that the login function is inside the 'User' model, but why should DMZ handle the login check automatically through $this->validate->get()?

I already have an Auth library which handles logins, I'd rather make an alias to it inside the User model, but still keeping the validation.

I hope I made my point clear enough! Smile

Thanks everybody.


DMZ 1.7.1 (DataMapper OverZealous Edition) - El Forum - 07-26-2010

[eluser]Wazzu[/eluser]
Order by foreing table field
Hi all. I have this two tables:
- products (id, name, category_id)
- categories (id, name)

So I make a list of products this way:

Code:
$p = new Product();
$p->order_by(category_id);
$p->get();
foreach($p as $product) {
  $product->category->get();
  echo $product->category->name . " " . $product->name . "<br />"
}

That way, my list gets ordered by category ID, but not by category name.
How should I do it?


DMZ 1.7.1 (DataMapper OverZealous Edition) - El Forum - 07-26-2010

[eluser]gyo[/eluser]
Quick guess... could it be that you didn't use order_by for categories?

$product->category->order_by('name')->get();


DMZ 1.7.1 (DataMapper OverZealous Edition) - El Forum - 07-26-2010

[eluser]Wazzu[/eluser]
[quote author="gyo / suashi" date="1280164044"]$product->category->order_by('name')->get();[/quote]
Shouldn't I populate product categories first?


DMZ 1.7.1 (DataMapper OverZealous Edition) - El Forum - 07-26-2010

[eluser]Wazzu[/eluser]
Got it working using include_related() method
:-)


DMZ 1.7.1 (DataMapper OverZealous Edition) - El Forum - 07-26-2010

[eluser]gyo[/eluser]
Good to know! Big Grin

Btw... are you using DMZ for handling logins too?


DMZ 1.7.1 (DataMapper OverZealous Edition) - El Forum - 07-26-2010

[eluser]BRK Network[/eluser]
[quote author="gyo / suashi" date="1280168344"]Good to know! Big Grin

Btw... are you using DMZ for handling logins too?[/quote]

Yes, wondering the same thing.

I'm unsure about using an Authentication or simple login library along with DMZ - considering the power of DMZ is providing to us.

Any real life experiences and/or best practices on authentication, session management and user management with DMZ?

Thanks...