Re: 3.0: a peek into CakePHP's future

2012-07-10 Thread WyriHaximus
http://php.net/manual/en/class.serializable.php :).

On Tuesday, July 10, 2012 3:57:20 AM UTC+2, madi wrote:

 Wouldn't array be still used? For instance more than one objects are 
 passed, should the objects be stored in an array? What would happen to the 
 auto conversion to json? Array is easier to convert to json rite? 
 On Jul 10, 2012 1:19 AM, Jamescowhen x...@splitp.com wrote:

 I would think moving to a more object oriented model will result in 
 better readable code and IDE auto completion will be more useful. 

 On Sunday, July 8, 2012 7:12:32 PM UTC-7, Greg wrote:

 For mine, being able to deal with objects in the view would greatly 
 improve the readability of data (the whole $user['User']['email'] etc looks 
 incredibly difficult to read to me, compared with $user-email which would 
 be much nicer).

 I've always felt dealing with arrays is a bit of a 'hack'. I understand 
 the choice, but I think the idea to move towards a more object oriented 
 approach is more than hype, and long overdue.


 On Sat, Jul 7, 2012 at 7:35 PM, tigr alb...@tigr.net wrote:

 No, that is not nice. The strength of the CakePHP design is in being 
 very straightforward when it comes to working with the data. I have seen 
 other frameworks and I think that object-oriented ways are not suitable 
 for 
 working with data. Well, of course, you can, but would you want to, given 
 a 
 choice? My answer was no and that is why I am using Cake. I am worried 
 that the object-oriented hype will get the best of you and we will lose a 
 perfectly sensible data processing framework to the object-oriented glory. 
 For practical reasons, it would be great to leave the model layer 
 principles as they are.

  -- 
 Our newest site for the community: CakePHP Video Tutorials 
 http://tv.cakephp.org 
 Check out the new CakePHP Questions site http://ask.cakephp.org and 
 help others with their CakePHP related questions.
  
  
 To unsubscribe from this group, send email to
 cake-php+unsubscribe@**googlegroups.comcake-php%2bunsubscr...@googlegroups.comFor
  more options, visit this group at 
 http://groups.google.com/**group/cake-phphttp://groups.google.com/group/cake-php


  -- 
 Our newest site for the community: CakePHP Video Tutorials 
 http://tv.cakephp.org 
 Check out the new CakePHP Questions site http://ask.cakephp.org and help 
 others with their CakePHP related questions.
  
  
 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.com For more options, visit this group 
 at http://groups.google.com/group/cake-php



-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Issues with edits and afterSave in Cake 2.2

2012-07-10 Thread Ernesto
hi all thx for the response.

@cricket
thanks for the suggestion, i'll try your way

@albert
the data in the DB is ok


Il giorno venerdì 6 luglio 2012 12:06:03 UTC+2, Ernesto ha scritto:

 Hi all

 i'm having a weird issue with Cake 2.2 model's afterSave()

 i need to update some csv files after any order has been saved or updated.
 to achieve this i made a function processCsv wich is called by my 
 afterSave().

 but my finds() called afterSave() are returning the data without the last 
 updates. why?

 here's my code

 //in controller
 $this-Order-save($this-data);

 //in Order model
 public function afterSave ($created) {
 $this-processCsv($this-data[Order][id]);
 }

 public function processCsv ($id) {
 pr($this-findById($id));
 //my code goes here
 }


-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: getting javascript helpers missing error.

2012-07-10 Thread oDiN


echo $this-Html-css('styles');

This is how u link the css file .. make sure you put in /app/webroot/css.

If the css is still not loaded .. view source and paste the link here.

On Friday, 22 June 2012 19:15:00 UTC+8, shamsuddin mohammed wrote:

 thanks i got it but the css is not working.


 with Regards,

SHAMSUDDIN MOHD
 MCA
 Hyderabad
 Cell: +91- 9642955952, 8985188330




 On Fri, Jun 22, 2012 at 2:59 PM, Raj Dudi rajender...@gmail.com wrote:

 Yeah then in your articles controller, you should use helper as Js.Also 
 in index.php you should change $Javascript to $this-Js


 On Fri, Jun 22, 2012 at 11:12 AM, shamsuddin mohammed 
 mdshamsuddin@gmail.com wrote:

 yes i am using cakephp2. what should i do? shall i write Js inside of 
 javascript. 


 with Regards,

SHAMSUDDIN MOHD
 MCA
 Hyderabad
 Cell: +91- 9642955952, 8985188330




 On Fri, Jun 22, 2012 at 2:38 PM, Raj Dudi rajender...@gmail.com wrote:

 What is the version of cakephp ? cakephp 2 do not have javascript 
 helper. cakephp2 has Js helper 

 On Friday, 22 June 2012 11:00:40 UTC+2, shamsuddin mohammed wrote:

 i have written a controller ArticlesController.php with the following 
 code


 ?php
 class ArticlesController extends AppController {
 var $uses=null;
 var $name = 'Articles';
 var $helpers = array('Html','Form','**Javascript'); 

  function index() {

   $this-set('page_heading', 'Jquery Tab');   

}

 }
 ?

 is it the right or not. if not how to include. 


 with Regards,

SHAMSUDDIN MOHD
   **  MCA
   **  Hyderabad
 Cell: +91- 9642955952, 8985188330




 On Fri, Jun 22, 2012 at 1:54 PM, Raj Dudi rajender...@gmail.comwrote:

 Also to include the Javascript library, you can use 
 echo $html-script(jquery); 

 On Friday, 22 June 2012 10:22:27 UTC+2, Raj Dudi wrote:

 Hello,

 Which version of cakephp are you using ? If you are using cakephp2, 
 then javascript helper is no more there and you should use Js helper.
 Also in your controller, you need to include these helpers. Your 
 error indicates that you have not included the Js helper. 

 // In controller 
 public helpers = array('Js');




 On Friday, 22 June 2012 08:22:31 UTC+2, shamsuddin mohammed wrote:

 i have downloaded jqueryui from the site and pasted javascript 
 files in js folder and css files in css folder next i have created a 
 folder 
 called article in View and their i created index.php with the 
 following 
 code.

 ?php
 $javascript-link('jquery-ui-**1**.8.21.custom.min.js', false);
 $javascript-link('jquery.ui.**t**abs.js', false);
 ?
 link rel=stylesheet href=?php //echo $this-webroot . 'css/'; 
 ?/jquery-ui-1.8.21.custom.**css** type=text/css media=screen 
 /

  script type=text/javascript
$(function() {
$(#tabs).tabs();
});
 /script

 div id=tabs class=ui-tabs-nav

 ul
 lia href=#tabs-1tabs-1/a/li
 lia href=#tabs-2tabs-2/a/li
 lia href=#tabs-3tabs-3/a/li
 /ul
 div id=tabs-1

 pTab 1. This is demo text. This is demo text.This is demo 
 text.This is demo text.This is demo text.This is demo text.This is 
 demo 
 text.This is demo text.This is demo text./p
 /div
 div id=tabs-2
 pTab 2. This is demo text.This is demo text.This is demo 
 text.This is demo text.This is demo text.This is demo text.This is 
 demo 
 text.This is demo text.This is demo text./p
 /div
 div id=tabs-3

 pTab 3.This is demo text.This is demo text.This is demo 
 text.This is demo text.This is demo text.This is demo text.This is 
 demo 
 text.This is demo text.This is demo text./p
 /div
 /div


 when i run this i am getting the following error:

 Missing Helper 

 *Error: * *JavascriptHelper* could not be found.

 *Error: * Create the class *JavascriptHelper* below in file: 
 app\View\Helper\**JavascriptHelp**er.php

 ?php
 class JavascriptHelper extends AppHelper {

 }

  *Notice: * If you want to customize this error message, create 
 app\View\Errors\missing_**helper**.ctp
 Stack Trace 

- CORE\Cake\View\View.php line 
 850http://localhost/cake/articles#→ HelperCollection-load(string, 
array) http://localhost/cake/articles# 
- CORE\Cake\View\View.php line 
 456http://localhost/cake/articles#→ 
View-loadHelpers() http://localhost/cake/articles# 
- CORE\Cake\Controller\**Controlle**r.php line 
 959http://localhost/cake/articles#→ View-render(null, 
null) http://localhost/cake/articles# 
- CORE\Cake\Routing\Dispatcher.**p**hp line 
 110http://localhost/cake/articles#→ 
Controller-render() http://localhost/cake/articles# 
- CORE\Cake\Routing\Dispatcher.**p**hp line 
 85http://localhost/cake/articles#→ 
Dispatcher-_invoke(**ArticlesCo**ntroller, 

SaveAll issue with nested arrays

2012-07-10 Thread Michael Gaiser
When I pass this array to my saveAll function, the events get saved
but the feeding and the character do not. Is there an issue with
multiple levels of indexed arrays? Would I be better off trying to
save them individually?



array(
(int) 0 = array(
'Event' = array(
'event_type_id' = (int) 1,
'chronicle_id' = '1',
'start_date' = '2011-08-21',
'end_date' = '2011-08-21',
'confirmed_id' = (int) 1,
'location_id' = '4',
'created' = '2011-08-21 04:19:24'
),
'Feeding' = array(
(int) 0 = array(
'location_id' = '42',
'amount' = '11',
'created' = '2011-08-21 04:19:24'
),
(int) 1 = array(
'location_id' = '38',
'amount' = '11',
'created' = '2011-08-21 04:17:09'
),
(int) 2 = array(
'location_id' = '46',
'amount' = '11',
'created' = '2011-08-21 04:18:03'
)
),
'Character' = array(
(int) 0 = array(
'character_id' = '35',
'role_id' = (int) 5
)
)
),

)


Thanks.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: CakeDC User Plugin not sending verification email

2012-07-10 Thread mk
Just to close loop on this... This is resolved, I was not calling correct 
config from my email.php. once I added 

-config('smtp')

it worked...

Thanks again

On Monday, July 9, 2012 8:04:26 PM UTC-5, mk wrote:

 Thanks for the reply... I will review my email.php again and hope to find 
 my error.

 thanks again
 mk

 On Monday, July 9, 2012 6:25:48 PM UTC-5, sams wrote:

 Your email cfg is incorrect with your app - see Config/email.php

 - S
 On 9 Jul 2012 23:45, mk mklap...@gmail.com wrote:

 yes, sorry typo. it is configure::write in my code. The Error simply 
 states 
 Could not send email. 

 *Error: * An Internal Error Has Occurred.

 I'm running this from localhost and maybe my smtp setup?... although I 
 thought I had it setup correctly.

 Thanks
 On Monday, July 9, 2012 5:03:32 PM UTC-5, cricket wrote:

 I don't see an error message, just the stacktrace. 

 Is this a typo? Configure::wrote (should be write) 

 On Mon, Jul 9, 2012 at 4:34 PM, mk mklap...@gmail.com wrote: 
  Hi 
  
  
  
  I’m trying to implement the 2.0 branch of the CakeDC Users Plugin 
  (https://github.com/CakeDC/**users/tree/2.0https://github.com/CakeDC/users/tree/2.0)
   
 , I have installed all necessary 
  plugins and I’m able to get to registration form, yet when I register 
 I do 
  not receive any confirmation instead I receive the following errors: 
  
  
  
  Any insight into what I have wrong? I have updated the default “from” 
 email 
  setting in my bootstrap to Configure::wrote(‘App.**defaultEmail’, 
  ‘myaddr...@email.com’)…. 
  
  
  
  Thanks in advance for any help 
  
  Mk 
  
  
  
  Stack Trace: 
  
  ·  CORE\Cake\Network\Email\**CakeEmail.php line 972 → 
  MailTransport-send(CakeEmail) 
  
  $this-_createBoundary(); 
  
  
  
  $this-_message = $this-_render($this-_wrap($**content)); 
  
  
  
  
  
  
  
  $contents = $this-transportClass()-send(**$this); 
  
  
  
  if (!empty($this-_config['log'])**) { 
  
  ·  APP\Plugin\users\Controller\**UsersController.php line 583 → 
  CakeEmail-send() 
  
  -viewVars(array( 
  
  'model' = $this-modelClass, 
  
  'user' = $userData)) 
  
  -send(); 
  
  } 
  
  ·  APP\Plugin\users\Controller\**UsersController.php line 323 → 
  UsersController-_**sendVerificationEmail(array) 
  
  if (!empty($this-request-data)) { 
  
  $user = $this-User-register($this-**request-data); 
  
  if ($user !== false) { 
  
  $this-_sendVerificationEmail(**$this-User-data); 
  
  $this-Session-setFlash(__d('**users', 'Your 
 account has been 
  created. You should receive an e-mail shortly to authenticate your 
 account. 
  Once validated you will be able to login.')); 
  
  
  
  
  
  ·  [internal function] → UsersController-add() 
  
  ·  CORE\Cake\Controller\**Controller.php line 485 → 
  ReflectionMethod-invokeArgs(**UsersController, array) 
  
  ·  CORE\Cake\Routing\Dispatcher.**php line 103 → 
  Controller-invokeAction(**CakeRequest) 
  
  ·  CORE\Cake\Routing\Dispatcher.**php line 85 → 
  Dispatcher-_invoke(**UsersController, CakeRequest, CakeResponse) 
  
  ·  APP\webroot\index.php line 97 → Dispatcher-dispatch(**CakeRequest, 

  CakeResponse) 
  
  -- 
  Our newest site for the community: CakePHP Video Tutorials 
  http://tv.cakephp.org 
  Check out the new CakePHP Questions site http://ask.cakephp.org and 
 help 
  others with their CakePHP related questions. 
  
  
  To unsubscribe from this group, send email to 
  cake-php+unsubscribe@**googlegroups.comcake-php%2bunsubscr...@googlegroups.comFor
   more options, visit this group at 
  http://groups.google.com/**group/cake-phphttp://groups.google.com/group/cake-php
   

  -- 
 Our newest site for the community: CakePHP Video Tutorials 
 http://tv.cakephp.org 
 Check out the new CakePHP Questions site http://ask.cakephp.org and 
 help others with their CakePHP related questions.
  
  
 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.com For more options, visit this 
 group at http://groups.google.com/group/cake-php



-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: CakeDC User Plugin not sending verification email

2012-07-10 Thread mk


 Just to close loop on this... This is resolved, I was not calling correct 
 config from my email.php. once I added 

 -config('smtp')

 it worked...

 Thanks again

 On Monday, July 9, 2012 8:04:26 PM UTC-5, mk wrote:

 Thanks for the reply... I will review my email.php again and hope to find 
 my error.

 thanks again
 mk

 On Monday, July 9, 2012 6:25:48 PM UTC-5, sams wrote:

 Your email cfg is incorrect with your app - see Config/email.php

 - S
 On 9 Jul 2012 23:45, mk mklap...@gmail.com wrote:

 yes, sorry typo. it is configure::write in my code. The Error simply 
 states 
 Could not send email. 

 *Error: * An Internal Error Has Occurred.

 I'm running this from localhost and maybe my smtp setup?... although I 
 thought I had it setup correctly.

 Thanks
 On Monday, July 9, 2012 5:03:32 PM UTC-5, cricket wrote:

 I don't see an error message, just the stacktrace. 

 Is this a typo? Configure::wrote (should be write) 

 On Mon, Jul 9, 2012 at 4:34 PM, mk mklap...@gmail.com wrote: 
  Hi 
  
  
  
  I’m trying to implement the 2.0 branch of the CakeDC Users Plugin 
  (https://github.com/CakeDC/**users/tree/2.0https://github.com/CakeDC/users/tree/2.0)
   
 , I have installed all necessary 
  plugins and I’m able to get to registration form, yet when I 
 register I do 
  not receive any confirmation instead I receive the following errors: 
  
  
  
  Any insight into what I have wrong? I have updated the default 
 “from” email 
  setting in my bootstrap to Configure::wrote(‘App.**defaultEmail’, 
  ‘myaddr...@email.com’)…. 
  
  
  
  Thanks in advance for any help 
  
  Mk 
  
  
  
  Stack Trace: 
  
  ·  CORE\Cake\Network\Email\**CakeEmail.php line 972 → 
  MailTransport-send(CakeEmail) 
  
  $this-_createBoundary(); 
  
  
  
  $this-_message = $this-_render($this-_wrap($**content)); 
  
  
  
  
  
  
  
  $contents = $this-transportClass()-send(**$this); 
  
  
  
  if (!empty($this-_config['log'])**) { 
  
  ·  APP\Plugin\users\Controller\**UsersController.php line 583 → 
  CakeEmail-send() 
  
  -viewVars(array( 
  
  'model' = $this-modelClass, 
  
  'user' = $userData)) 
  
  -send(); 
  
  } 
  
  ·  APP\Plugin\users\Controller\**UsersController.php line 323 → 
  UsersController-_**sendVerificationEmail(array) 
  
  if (!empty($this-request-data)) { 
  
  $user = $this-User-register($this-**request-data); 
  
  if ($user !== false) { 
  
  $this-_sendVerificationEmail(**$this-User-data); 
  
  $this-Session-setFlash(__d('**users', 'Your 
 account has been 
  created. You should receive an e-mail shortly to authenticate your 
 account. 
  Once validated you will be able to login.')); 
  
  
  
  
  
  ·  [internal function] → UsersController-add() 
  
  ·  CORE\Cake\Controller\**Controller.php line 485 → 
  ReflectionMethod-invokeArgs(**UsersController, array) 
  
  ·  CORE\Cake\Routing\Dispatcher.**php line 103 → 
  Controller-invokeAction(**CakeRequest) 
  
  ·  CORE\Cake\Routing\Dispatcher.**php line 85 → 
  Dispatcher-_invoke(**UsersController, CakeRequest, CakeResponse) 
  
  ·  APP\webroot\index.php line 97 → Dispatcher-dispatch(**CakeRequest, 

  CakeResponse) 
  
  -- 
  Our newest site for the community: CakePHP Video Tutorials 
  http://tv.cakephp.org 
  Check out the new CakePHP Questions site http://ask.cakephp.org and 
 help 
  others with their CakePHP related questions. 
  
  
  To unsubscribe from this group, send email to 
  cake-php+unsubscribe@**googlegroups.comcake-php%2bunsubscr...@googlegroups.comFor
   more options, visit this group at 
  http://groups.google.com/**group/cake-phphttp://groups.google.com/group/cake-php
   

  -- 
 Our newest site for the community: CakePHP Video Tutorials 
 http://tv.cakephp.org 
 Check out the new CakePHP Questions site http://ask.cakephp.org and 
 help others with their CakePHP related questions.
  
  
 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.com For more options, visit this 
 group at http://groups.google.com/group/cake-php



-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Working with Profiles

2012-07-10 Thread mohit
I have tried searching it over the internet also but I am bit confused.

I have to create an application which has to specify lot of checkboxes for 
profiles which display their skills(more than 80)
A user has to click a skill that he has.

I have a design issue, How to proceed with the schema, I can make a 
database field for each item, but that will not be feasible.

Any ideas or help will be appreciated.

Thanks, 
Mohit

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


How to use ClassRegistry::getObject('view') in cake 2.2?

2012-07-10 Thread Lucas Simon Rodrigues Magalhaes
I'm using this, $view = ClassRegistry::getObject('view'); in my Helper but 
does not work.

I imported App::uses('ClassRegistry', 'Utility');

but nothing ... and my debug( $view = ClassRegistry::getObject('view')); 
always return false


-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Cake 2 - Model name

2012-07-10 Thread MrMariscal
I have a problem with naming a model my database table is named:  
siegjal_fuenteshttp://192.168.251.6/phpmyadmin/sql.php?db=sieggob_siegjaltable=siegjal_fuentestoken=a8f1dcbd7decf8348a4389455f5cb006
 so 
when I use in my controller the: $this-loadModel('SiegjalFuente'); it 
works perfectly normal, I can even insert new records, I'm trying to define 
a model so I can give specif rules for database insertions, but I cannot 
get the right name of the file so cake recognizes it, I defined the model: 

?php
class Siegjal_Fuentes extends AppModel {
public $name = 'Siegjal_Fuentes';
public $primaryKey = 'idejemplo';
}
?

Here it should chamge the primary key field and must give me an error as 
long as there is not idejemplo field in the table, but it works so I guess 
it is inferring the model and it's not taking mine.

Any suggetions?

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Fast alternative to contains?

2012-07-10 Thread Christian
Hi there,

I have the following find query:



$categoryItems_all = $this-Category-find('all', array('contain' = 
 array('Productgroup' = array('Fee' = array('conditions' = 
 array('Fee.country_id' = $this-__getCountryId()
   
   
 )
   
 
 ),
   
  
 'Product' = array('Productoption' = array('Color',
   
   
 'Material',
   
   
 'Size',
   
   
 'Icon',
   
   
 ),
   
 
 'Vendor'
   
 
 )
   
   
 )
 ),
 'conditions' = 
 array('Category.parent_id' = $id, 
   
 'Category.active' = '1', 
   
 'Category.display' = '1'
   )
 )
);


If I pack the same query in a flat SQL view, it has 750 rows (and takes 
same milii seconds). My Problem with the containable in find query is, that 
cake splits it up into ~1!! queries which takes approximately 10 
seconds and the database is not yet half filled with all items.

Is there any alternative to use the containable behaviour which returns a 
similar result but with a better performance? As a workaround I'm currently 
using the view, but flat data was not was I was looking for. The joins 
options doesn't work either, since the result just contains the data of the 
model the find query was running on.

Thanks,
Christian

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Working with Profiles

2012-07-10 Thread Harsha M V
users(id, name, email,...)
skills (id, name, description..)
users_skills (id, user_id, skill_id) -- HABTM join table

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: SaveAll issue with nested arrays

2012-07-10 Thread Harsha M V
what are the relations of the models ? does Events hasMany with feedings 
and characters ?

 

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: How to use ClassRegistry::getObject('view') in cake 2.2?

2012-07-10 Thread lowpass
http://book.cakephp.org/2.0/en/appendices/2-0-migration-guide.html#view

On Tue, Jul 10, 2012 at 2:57 PM, Lucas Simon Rodrigues Magalhaes
lucass...@gmail.com wrote:
 I'm using this, $view = ClassRegistry::getObject('view'); in my Helper but
 does not work.

 I imported App::uses('ClassRegistry', 'Utility');

 but nothing ... and my debug( $view = ClassRegistry::getObject('view'));
 always return false


 --
 Our newest site for the community: CakePHP Video Tutorials
 http://tv.cakephp.org
 Check out the new CakePHP Questions site http://ask.cakephp.org and help
 others with their CakePHP related questions.


 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.com For more options, visit this group at
 http://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Cake 2 - Model name

2012-07-10 Thread lowpass
No underscore in model names.

class SiegjalFuentes extends AppModel

Also, you no longer need the $name var (was for PHP 4.x).


On Tue, Jul 10, 2012 at 2:58 PM, MrMariscal benjamin.maris...@gmail.com wrote:
 I have a problem with naming a model my database table is named:
 siegjal_fuentes so when I use in my controller the:
 $this-loadModel('SiegjalFuente'); it works perfectly normal, I can even
 insert new records, I'm trying to define a model so I can give specif rules
 for database insertions, but I cannot get the right name of the file so cake
 recognizes it, I defined the model:

 ?php
 class Siegjal_Fuentes extends AppModel {
 public $name = 'Siegjal_Fuentes';
 public $primaryKey = 'idejemplo';
 }
 ?

 Here it should chamge the primary key field and must give me an error as
 long as there is not idejemplo field in the table, but it works so I guess
 it is inferring the model and it's not taking mine.

 Any suggetions?

 --
 Our newest site for the community: CakePHP Video Tutorials
 http://tv.cakephp.org
 Check out the new CakePHP Questions site http://ask.cakephp.org and help
 others with their CakePHP related questions.


 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.com For more options, visit this group at
 http://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Fast alternative to contains?

2012-07-10 Thread lowpass
I guess the first question is, do you really need to fetch all 750
rows at once? Second, do you need to have all of that associated data
(Color, Icon, etc.)? I can't think of why you would unless you're
creating a report (ie. CSV file) or generating a *really* long HTML
page.

If yo really must grab all that data with your Categories, you could
try using a finderQuery in the Category model for the $hasMany
association.

On Tue, Jul 10, 2012 at 3:03 PM, Christian goo...@mein-schnuller.de wrote:
 Hi there,

 I have the following find query:



 $categoryItems_all = $this-Category-find('all', array('contain' =
 array('Productgroup' = array('Fee' = array('conditions' =
 array('Fee.country_id' = $this-__getCountryId()

 )

 ),

 'Product' = array('Productoption' = array('Color',

 'Material',

 'Size',

 'Icon',

 ),

 'Vendor'

 )

 )
 ),
 'conditions' =
 array('Category.parent_id' = $id,

 'Category.active' = '1',

 'Category.display' = '1'

 )
 )
);


 If I pack the same query in a flat SQL view, it has 750 rows (and takes same
 milii seconds). My Problem with the containable in find query is, that cake
 splits it up into ~1!! queries which takes approximately 10 seconds and
 the database is not yet half filled with all items.

 Is there any alternative to use the containable behaviour which returns a
 similar result but with a better performance? As a workaround I'm currently
 using the view, but flat data was not was I was looking for. The joins
 options doesn't work either, since the result just contains the data of the
 model the find query was running on.

 Thanks,
 Christian

 --
 Our newest site for the community: CakePHP Video Tutorials
 http://tv.cakephp.org
 Check out the new CakePHP Questions site http://ask.cakephp.org and help
 others with their CakePHP related questions.


 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.com For more options, visit this group at
 http://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


htacces and other page

2012-07-10 Thread gloop
Hello,

i need to access a other page on the main root /page

but the htaccess root all request to cakephp

how can i add e.g. /shop to the htaccess?

Kind Regards
gloop

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: SaveAll issue with nested arrays

2012-07-10 Thread Michael Gaiser
Yes. Events hasMany Feedings(events_feedings)  Characters
(characters_events), and they belongTo the Event.


On Tue, Jul 10, 2012 at 3:30 PM, Harsha M V har...@mink7.com wrote:

 what are the relations of the models ? does Events hasMany with feedings
 and characters ?



 --
 Our newest site for the community: CakePHP Video Tutorials
 http://tv.cakephp.org
 Check out the new CakePHP Questions site http://ask.cakephp.org and help
 others with their CakePHP related questions.


 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.com For more options, visit this group
 at http://groups.google.com/group/cake-php


-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


cannot post data using ajax

2012-07-10 Thread Gideon
Hi all, I am trying to send ajax data to an autocomplete action 
/researchers/autocomplete.json. I have set data[query]=daniel but still I 
get null for $this-request-data('query') or anything else for that 
matter. If anyone can help I'd be really appreciative.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: htacces and other page

2012-07-10 Thread lowpass
If the file is under webroot then Cake should ignore it and let Apache serve it.

On Tue, Jul 10, 2012 at 4:59 PM, gloop gl...@web.de wrote:
 Hello,

 i need to access a other page on the main root /page

 but the htaccess root all request to cakephp

 how can i add e.g. /shop to the htaccess?

 Kind Regards
 gloop

 --
 Our newest site for the community: CakePHP Video Tutorials
 http://tv.cakephp.org
 Check out the new CakePHP Questions site http://ask.cakephp.org and help
 others with their CakePHP related questions.


 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.com For more options, visit this group at
 http://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Session variables are PHP_Incomplete_Class, throwing errors

2012-07-10 Thread Wendall
Hi all,

I've set a session variable that I assign to an object.  When I load other 
pages, sometimes I can get data out of the session var, sometimes I can't.  
For example, I check a property of the object in the session var to 
dynamically assign a stylesheet to the page.  In some controller views, 
this stylesheet is being attached, while in some other views it is not.  
I'm not altering, deleting, or destroying my session var between these 
views, so am unsure as to why this is happening.  When I run a debug on 
this session var on the pages that it's not  working properly on, I'm 
seeing the object being described as an instance of 
__PHP_Incomplete_Class.  In the debug, I can see all the properties of 
the object, but when I try to do something simple like get the object's id, 
the id comes back as null and I get the following Notice:

The script tried to execute a method or access a property of an incomplete 
object. Please ensure that the class definition Team of the object you 
are trying to operate on was loaded _before_ unserialize() gets called or 
provide a __autoload() function to load the class definition.

Any thoughts on what's going on?  Am I trying to stuff too much data into a 
session var?  Thanks for any help.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


BrowniePHP

2012-07-10 Thread Marsson C.
Hi,


   Can I edit rich content with BrowniePHP ?

  I mean like if I had a CKEditor ?

   Thanks!

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Session variables are PHP_Incomplete_Class, throwing errors

2012-07-10 Thread rchavik


On Wednesday, July 11, 2012 7:01:07 AM UTC+7, Wendall wrote:

 Hi all,

 I've set a session variable that I assign to an object.  When I load other 
 pages, sometimes I can get data out of the session var, sometimes I can't.  
 For example, I check a property of the object in the session var to 
 dynamically assign a stylesheet to the page.  In some controller views, 
 this stylesheet is being attached, while in some other views it is not.  
 I'm not altering, deleting, or destroying my session var between these 
 views, so am unsure as to why this is happening.  When I run a debug on 
 this session var on the pages that it's not  working properly on, I'm 
 seeing the object being described as an instance of 
 __PHP_Incomplete_Class.  In the debug, I can see all the properties of 
 the object, but when I try to do something simple like get the object's id, 
 the id comes back as null and I get the following Notice:

 The script tried to execute a method or access a property of an incomplete 
 object. Please ensure that the class definition Team of the object you 
 are trying to operate on was loaded _before_ unserialize() gets called or 
 provide a __autoload() function to load the class definition.

 Any thoughts on what's going on?  Am I trying to stuff too much data into 
 a session var?  Thanks for any help.


Don't store objects in sessions? 

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Session variables are PHP_Incomplete_Class, throwing errors

2012-07-10 Thread John Hardy
The class Team is not in the scope of PHP. ( IE: the class has not been 
declared as a symbol )

You will need to overload the __autoload function and have the file where the 
class is declared included.

http://php.net/__autoload

On Jul 10, 2012, at 5:01 PM, Wendall wrote:

 Hi all,
 
 I've set a session variable that I assign to an object.  When I load other 
 pages, sometimes I can get data out of the session var, sometimes I can't.  
 For example, I check a property of the object in the session var to 
 dynamically assign a stylesheet to the page.  In some controller views, this 
 stylesheet is being attached, while in some other views it is not.  I'm not 
 altering, deleting, or destroying my session var between these views, so am 
 unsure as to why this is happening.  When I run a debug on this session var 
 on the pages that it's not  working properly on, I'm seeing the object being 
 described as an instance of __PHP_Incomplete_Class.  In the debug, I can 
 see all the properties of the object, but when I try to do something simple 
 like get the object's id, the id comes back as null and I get the following 
 Notice:
 
 The script tried to execute a method or access a property of an incomplete 
 object. Please ensure that the class definition Team of the object you are 
 trying to operate on was loaded _before_ unserialize() gets called or provide 
 a __autoload() function to load the class definition.
 
 Any thoughts on what's going on?  Am I trying to stuff too much data into a 
 session var?  Thanks for any help.
 
 -- 
 Our newest site for the community: CakePHP Video Tutorials 
 http://tv.cakephp.org 
 Check out the new CakePHP Questions site http://ask.cakephp.org and help 
 others with their CakePHP related questions.
  
  
 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
 http://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: SaveAll issue with nested arrays

2012-07-10 Thread Sergei
Whats your Cake version? Recently I had kinda similar problem with Cake 2.2.

I've encountered a weird behavior with nested array and saveAll 
function. Seems like it transforms your array to this before saving:

'Feeding' = array(

'Feeding' = array(

 (int) 0 = array(
'location_id' = '42',
'amount' = '11',
'created' = '2011-08-21 04:19:24'
)),

'Feeding' = array (

  (int) 1 = array(

'location_id' = '38',
'amount' = '11',
'created' = '2011-08-21 04:17:09'
)),

...


It adds another nested array for each data item. I think it's a bug.

-- 
Sergei


On Tuesday, July 10, 2012 9:57:15 PM UTC+9, Michael wrote:

 When I pass this array to my saveAll function, the events get saved but the 
 feeding and the character do not. Is there an issue with multiple levels of 
 indexed arrays? Would I be better off trying to save them individually? 



 array(
   (int) 0 = array(
   'Event' = array(
   'event_type_id' = (int) 1,
   'chronicle_id' = '1',
   'start_date' = '2011-08-21',
   'end_date' = '2011-08-21',
   'confirmed_id' = (int) 1,
   'location_id' = '4',
   'created' = '2011-08-21 04:19:24'
   ),
   'Feeding' = array(
   (int) 0 = array(
   'location_id' = '42',
   'amount' = '11',
   'created' = '2011-08-21 04:19:24'
   ),
   (int) 1 = array(
   'location_id' = '38',
   'amount' = '11',
   'created' = '2011-08-21 04:17:09'
   ),
   (int) 2 = array(
   'location_id' = '46',
   'amount' = '11',
   'created' = '2011-08-21 04:18:03'
   )
   ),
   'Character' = array(
   (int) 0 = array(
   'character_id' = '35',
   'role_id' = (int) 5
   )
   )
   ),

 )


 Thanks.




-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: cannot post data using ajax

2012-07-10 Thread dario gaston musante
try with a var_dump( $this-request-data ); or a 
debug($this-request-data);

El martes, 10 de julio de 2012 19:09:03 UTC-3, Gideon escribió:

 Hi all, I am trying to send ajax data to an autocomplete action 
 /researchers/autocomplete.json. I have set data[query]=daniel but still I 
 get null for $this-request-data('query') or anything else for that 
 matter. If anyone can help I'd be really appreciative.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php