Re: Inner Join cakephp

2013-02-25 Thread bau
I have updated the qeustion:

I have these 2 tables: cd_biblio (which contains a list of books) and 
cd_bibliotem (which contains only the id of book and id of tag).
I want to make a query where the user can choose also the tag of a book (in 
both tables the tags are numeric).
In the cd_biblios controller I add:

App::import('Model', 'CdBibliotem');$CdBibliotem = new CdBibliotem();

I made the queries for cd_biblio table in this way:

// General query$conditions = array(
'editore LIKE' => "%$e%",
'titolo LIKE' => "%$t%");

And then for example: 

if (!$anno)
$conditions[] = array('anno <=' => "$anno2");  if (!$anno2)
$conditions[] = array('anno >=' => "$anno");

Or: 

if (isset($menu)&&$menu!='')
$conditions[]=array('classe LIKE' => "%$menu%");

Now I need to do a inner join between these 2 tables to get all the books 
with a specific tags. 
I save tags in string, so I use: 
SELECT ... WHERE tags IN ('$tags'); 
But I can't make a inner join using $conditions. 

I tried something like this: 

$t = $CdBibliotem->query("SELECT * FROM cd_bibliotem WHERE codiceTematica = 
'$tematiche'"); $t = 
Set::classicExtract($t,'{n}.cd_bibliotem.codiceBiblio');

Now I need to compare these books ids (codiceBiblio) with that from the 
first query (with an inner join), so I tried:

$tem = $CdBibliotem->find('all', array('joins' => array( 
array( 
'table' => 'cd_biblio', 
'alias' => 'Tag', 
'type' => 'inner', 
'conditions'=> array('Tag.codiceBiblio' => $t) 
) ))); 

But it's not working, apache2 process start to take a lot of ram, and makes 
the PC unusable (I'm using cakephp ver 1.2)

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Model "Subject" not found

2013-02-25 Thread Paul Wiegers
Hi Thiago,


Maybe a search for "Subject" on files in your app folder?


thanks for your answer. Of course, my initial reaction was: I did, but I 
don't find anything! And I did a grep Subject * -R. But I looked over the 
results once more.
Turns out, I did have a field called subject_id. The funny thing is: 
symfony does not care about the _id part, but I guess CakePHP thinks, 
because of the _id, that this must be a reference to another table, which 
does, indeed, not exist.

So, I changed the fieldname - now, the views are generated by bake without 
any problems.

Thanks again for pointing me in the right direction!

regards,

Paul

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: How to install FirePHP on Cake PHP 2.3?

2013-02-25 Thread Saleh Souzanchi
hi
1- install DebugKit plugin https://github.com/cakephp/debug_kit
2- in bootstrap.php :

App::uses('FireCake','DebugKit.Lib');
>

3- now can use FirePHP : FireCake::log('hello');

On Tuesday, February 26, 2013 6:32:31 AM UTC+3:30, sphereweb wrote:
>
> Hello All,
>
> I have used CakePHP 1.3 in the past and had the FirePHP working very well. 
> Obviously now that i am coming back to CakePHP 2.3 the same installation 
> steps (as in previous version) do not apply.
>
> Can someone give me the steps on how to make FirePHP work with CakePHP?
>
> Thank you very much.
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: form prefill?

2013-02-25 Thread April DeRossett
Oh Gosh...of course.  Excellent, Thank you!  

On Monday, February 25, 2013 8:38:36 PM UTC-6, Felipe Zavan wrote:
>
> In the controller action for this view:
> $this->request->data['Biddetail']['bid_id'] = "some value or variable";
>
>
> 2013/2/25 April DeRossett >
>
>> is there a way to pre-populate forms?  here is what I have in my view:
>>
>> Form->create('Biddetail'); ?>
>> 
>> 
>> >* echo $this->Form->input('bid_id');*  *I want to pre-fill this 
>> field*
>> echo $this->Form->input('Property_Owner');
>> echo $this->Form->input('Opening_Date');
>> echo $this->Form->input('Propery_Address');
>> echo $this->Form->input('Property_City');
>> echo $this->Form->input('Property_State');
>> echo $this->Form->input('Property_Zip');
>> echo $this->Form->input('Property_County');
>> echo $this->Form->input('Control_Map');
>> echo $this->Form->input('Parcel');
>> echo $this->Form->input('Open_Date');
>> echo $this->Form->input('Open_Time');
>> echo $this->Form->input('Bid_Location');
>> echo $this->Form->input('Performance_Bond');
>> echo $this->Form->input('Contract_Signing');
>> echo $this->Form->input('Entry_Date');
>> echo $this->Form->input('Sold');
>> echo $this->Form->input('Board_Foot_Hardwood_Sawtimber');
>> echo $this->Form->input('Hardwood_Pulpwood_Tons');
>> echo $this->Form->input('Pine_Sawtimber_Tons');
>> echo $this->Form->input('Pine_Pulpwood_Tons');
>> ?>
>> 
>> Form->end(__('Submit')); ?>
>>
>> -- 
>> Like Us on FaceBook https://www.facebook.com/CakePHP
>> Find us on Twitter http://twitter.com/CakePHP
>>  
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "CakePHP" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to cake-php+u...@googlegroups.com .
>> To post to this group, send email to cake...@googlegroups.com
>> .
>> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>  
>>  
>>
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




How to install FirePHP on Cake PHP 2.3?

2013-02-25 Thread sphereweb
Hello All,

I have used CakePHP 1.3 in the past and had the FirePHP working very well. 
Obviously now that i am coming back to CakePHP 2.3 the same installation 
steps (as in previous version) do not apply.

Can someone give me the steps on how to make FirePHP work with CakePHP?

Thank you very much.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: form prefill?

2013-02-25 Thread Felipe Zavan
In the controller action for this view:
$this->request->data['Biddetail']['bid_id'] = "some value or variable";


2013/2/25 April DeRossett 

> is there a way to pre-populate forms?  here is what I have in my view:
>
> Form->create('Biddetail'); ?>
> 
> 
> * echo $this->Form->input('bid_id');*  *I want to pre-fill this
> field*
> echo $this->Form->input('Property_Owner');
> echo $this->Form->input('Opening_Date');
> echo $this->Form->input('Propery_Address');
> echo $this->Form->input('Property_City');
> echo $this->Form->input('Property_State');
> echo $this->Form->input('Property_Zip');
> echo $this->Form->input('Property_County');
> echo $this->Form->input('Control_Map');
> echo $this->Form->input('Parcel');
> echo $this->Form->input('Open_Date');
> echo $this->Form->input('Open_Time');
> echo $this->Form->input('Bid_Location');
> echo $this->Form->input('Performance_Bond');
> echo $this->Form->input('Contract_Signing');
> echo $this->Form->input('Entry_Date');
> echo $this->Form->input('Sold');
> echo $this->Form->input('Board_Foot_Hardwood_Sawtimber');
> echo $this->Form->input('Hardwood_Pulpwood_Tons');
> echo $this->Form->input('Pine_Sawtimber_Tons');
> echo $this->Form->input('Pine_Pulpwood_Tons');
> ?>
> 
> Form->end(__('Submit')); ?>
>
> --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to cake-php+unsubscr...@googlegroups.com.
> To post to this group, send email to cake-php@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




form prefill?

2013-02-25 Thread April DeRossett
is there a way to pre-populate forms?  here is what I have in my view:

Form->create('Biddetail'); ?>


Form->input('bid_id');*  *I want to pre-fill this field
*
echo $this->Form->input('Property_Owner');
echo $this->Form->input('Opening_Date');
echo $this->Form->input('Propery_Address');
echo $this->Form->input('Property_City');
echo $this->Form->input('Property_State');
echo $this->Form->input('Property_Zip');
echo $this->Form->input('Property_County');
echo $this->Form->input('Control_Map');
echo $this->Form->input('Parcel');
echo $this->Form->input('Open_Date');
echo $this->Form->input('Open_Time');
echo $this->Form->input('Bid_Location');
echo $this->Form->input('Performance_Bond');
echo $this->Form->input('Contract_Signing');
echo $this->Form->input('Entry_Date');
echo $this->Form->input('Sold');
echo $this->Form->input('Board_Foot_Hardwood_Sawtimber');
echo $this->Form->input('Hardwood_Pulpwood_Tons');
echo $this->Form->input('Pine_Sawtimber_Tons');
echo $this->Form->input('Pine_Pulpwood_Tons');
?>

Form->end(__('Submit')); ?>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Fatal error: Call to undefined function __l()

2013-02-25 Thread Miguel Carvalho
Osamo, 

did you've managed to solve this problem? i'm facing the same one .

Thanks. 


On Thursday, 13 January 2011 20:15:27 UTC, cricket wrote:
>
> On Wed, Jan 12, 2011 at 8:11 AM, osamo101 > 
> wrote:
> > Should I just through it away and continue?
>
> I think you should look for this __l() function in the original app's
> bootstrap.php (or maybe it's in core.php, although putting it there
> would be wrong). There's got to be a rational reason for all of the
> calls to it in the app. It appears to be a wrapper to one of the
> translation functions.
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




How to make a site like ask.cakephp.org?

2013-02-25 Thread Cesar Felipe


Hi I need make a site like ask.cakephp.org... Do I have to do it from 
scratch or there is any plugin, tutorial, script or anything that I can use?

Thanks

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: autocomplete issue in cake 1.3

2013-02-25 Thread Chris
sorry guys,... I misstyped form,... this is the right one: 

Form->create('User', array('url' => '/users/search')); ?>


Ajax->autoComplete('User.name', '/users/autoComplete', 
array('label' => false)); ?>



Form->end(__('Search', true)); ?>


On Friday, February 22, 2013 4:30:42 PM UTC-8, Chris wrote:
>
> hi guys,... can someone help please,... I have a autocomplete issue in 
> cake 1.3 
> I'm using jquery helper from http://www.cakephp.4uk.pl/ajax/autoComplete 
> I manage to see the results in form field, 
>
> this is my search.ctp file: 
>
> 
>
> Form->create('User', array('action' => 'search')); ?>
> Form->text('firstname', array('style' => 'width: 60px')) 
> ?> 
>
> Form->text('User.email', array('style' => 'width: 
> 60px')) ?> 
>
> Form->text('User.city', array('style' => 'width: 60px')) 
> ?> 
> Form->end(__('Search', true)); ?>
> 
>
> 
>   
>   link($profileShow->buddy($user_obj), '/profile/' . 
> $user_obj['User']['username'], array('escape'=>false)) ?>
>   <.div>
> 
>
> this is auto_complete.ctp 
>
> 
>  $member['User']['lastname'] . "\n" ?>
> 
>
>
>
> this is my controller functions: 
>
> function autoComplete() {
>
> $this->set('members', $this->User->find('all', array(
> 'conditions' => array(
> 'OR' => array( 
> 'User.firstname LIKE' => 
> $this->params['url']['q'].'%', 
> 'User.lastname LIKE' => $this->params['url']['q'].'%'
> )),
> 'fields' => array('firstname', 'lastname')
> )));
> $this->layout = 'ajax';
> }
>
>   function search() 
>   {
> $this->User->recursive = 0;
> $this->set('users', $this->paginate());
>
>   }
>
> I can see ALL users with pagination in that page, but not the user that I 
> search... 
> Please help,... 
>
> Thanks in advance 
> chris 
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Stuck with migration from 1.3 to 2.x / euromark plugin

2013-02-25 Thread Anja Liebermann
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi euromark,


some questions to your readme:

a) Copy this plugin into your /app/Plugin folder
My app doesn't have a Plugin folder just a plugins folder. So I created
an empty folder Plugin.
Was that correct?

b) I copied the contents of the Zip file in that folder so that I have 3
subfolders: Console,  Lib,  Test
Was taht correct or should the folder upgrade-master go there?

c) In your readmy you mention "Run any of the above commands." My
problem is that nowhere above you mention any commands. That comes
later. So to which commands are you referring?

d) If I try to run the following command (being in my app folder)
/var/www/cakephp-2.3.0/app$ ../lib/Cake/Console/cake Upgrade.Upgrade
locations -v


I get the following output:
PHP MissingPluginException:  Plugin Upgrade could not be found. in
/var/www/cakephp-2.3.0/lib/Cake/Core/CakePlugin.php on line 142
PHP Stack trace:
PHP   1. {main}() /var/www/cakephp-2.3.0/lib/Cake/Console/cake.php:0
PHP   2. ShellDispatcher::run($argv = array (0 =>
'/var/www/cakephp-2.3.0/lib/Cake/Console/cake.php', 1 => '-working', 2
=> '/var/www/cakephp-2.3.0/app', 3 => 'Upgrade.Upgrade', 4 =>
'locations', 5 => '-v')) /var/www/cakephp-2.3.0/lib/Cake/Console/cake.php:43
PHP   3. ShellDispatcher->dispatch()
/var/www/cakephp-2.3.0/lib/Cake/Console/ShellDispatcher.php:67
PHP   4. ShellDispatcher->_getShell($shell = 'Upgrade.Upgrade')
/var/www/cakephp-2.3.0/lib/Cake/Console/ShellDispatcher.php:189
PHP   5. class_exists('UpgradeShell')
/var/www/cakephp-2.3.0/lib/Cake/Console/ShellDispatcher.php:239
PHP   6. App::load($className = 'UpgradeShell')
/var/www/cakephp-2.3.0/lib/Cake/Console/ShellDispatcher.php:0
PHP   7. App::path($type = 'Console/Command', $plugin = 'Upgrade')
/var/www/cakephp-2.3.0/lib/Cake/Core/App.php:542
PHP   8. App::pluginPath($plugin = 'Upgrade')
/var/www/cakephp-2.3.0/lib/Cake/Core/App.php:225
PHP   9. CakePlugin::path($plugin = 'Upgrade')
/var/www/cakephp-2.3.0/lib/Cake/Core/App.php:364


MissingPluginException: Plugin Upgrade could not be found. in
/var/www/cakephp-2.3.0/lib/Cake/Core/CakePlugin.php on line 142

Call Stack:
0.0003 232072   1. {main}()
/var/www/cakephp-2.3.0/lib/Cake/Console/cake.php:0
0.0095 317704   2. ShellDispatcher::run($argv = array (0 =>
'/var/www/cakephp-2.3.0/lib/Cake/Console/cake.php', 1 => '-working', 2
=> '/var/www/cakephp-2.3.0/app', 3 => 'Upgrade.Upgrade', 4 =>
'locations', 5 => '-v')) /var/www/cakephp-2.3.0/lib/Cake/Console/cake.php:43
0.06371920272   3. ShellDispatcher->dispatch()
/var/www/cakephp-2.3.0/lib/Cake/Console/ShellDispatcher.php:67
0.06381920576   4. ShellDispatcher->_getShell($shell =
'Upgrade.Upgrade')
/var/www/cakephp-2.3.0/lib/Cake/Console/ShellDispatcher.php:189
0.06401922128   5. class_exists('UpgradeShell')
/var/www/cakephp-2.3.0/lib/Cake/Console/ShellDispatcher.php:239
0.06401922424   6. App::load($className = 'UpgradeShell')
/var/www/cakephp-2.3.0/lib/Cake/Console/ShellDispatcher.php:0
0.06411923032   7. App::path($type = 'Console/Command', $plugin
= 'Upgrade') /var/www/cakephp-2.3.0/lib/Cake/Core/App.php:542
0.06411923168   8. App::pluginPath($plugin = 'Upgrade')
/var/www/cakephp-2.3.0/lib/Cake/Core/App.php:225
0.06411923200   9. CakePlugin::path($plugin = 'Upgrade')
/var/www/cakephp-2.3.0/lib/Cake/Core/App.php:364

Dump $_SERVER
   $_SERVER['HTTP_HOST'] is undefined
   $_SERVER['SERVER_NAME'] is undefined

Variables in local scope (#9):
  $_plugins = *uninitialized*
  $plugin = 'Upgrade'

Error: Plugin Upgrade could not be found.
#0 /var/www/cakephp-2.3.0/lib/Cake/Core/App.php(364):
CakePlugin::path('Upgrade')
#1 /var/www/cakephp-2.3.0/lib/Cake/Core/App.php(225):
App::pluginPath('Upgrade')
#2 /var/www/cakephp-2.3.0/lib/Cake/Core/App.php(542):
App::path('Console/Command', 'Upgrade')
#3 [internal function]: App::load('UpgradeShell')
#4 [internal function]: spl_autoload_call('UpgradeShell')
#5 /var/www/cakephp-2.3.0/lib/Cake/Console/ShellDispatcher.php(239):
class_exists('UpgradeShell')
#6 /var/www/cakephp-2.3.0/lib/Cake/Console/ShellDispatcher.php(189):
ShellDispatcher->_getShell('Upgrade.Upgrade')
#7 /var/www/cakephp-2.3.0/lib/Cake/Console/ShellDispatcher.php(67):
ShellDispatcher->dispatch()
#8 /var/www/cakephp-2.3.0/lib/Cake/Console/cake.php(43):
ShellDispatcher::run(Array)
#9 {main}

Ouch
Ok the Ouch was mine  ;) Just a test if you read until here.

As always any help is appreciated!

Calamity Jane





Am 24.02.2013 15:48, schrieb euromark:
> You did read the readme.txt right? :)
> It answers all of your questions above and many more..
> 
> 
> Am Sonntag, 24. Februar 2013 14:05:52 UTC+1 schrieb acl68:
>>
> Hi everybody,
> 
> 
> after getting strange error messages with the default 2.0 migration
> shell I tried it now with the improved version from euromark:
> https://github.com/dereuromark/upgrade
> 
> 
> Here the facts:
> I am running Linux with php 5.4.
> I downloaded cake 2.3.0 and e

Re: Model "Subject" not found

2013-02-25 Thread Thiago Belem
Maybe a search for "Subject" on files in your app folder?

Maybe you should try to bake with a plain new application, generated with
cake bake app-name or just a new unpacked CakePHP.

I also recommend you to use "cake bake all " so it should
generate the model, the controller and the views of the given model.

Regards,

--
***Thiago Belem*
Desenvolvedor
Rio de Janeiro - RJ - Brasil

*Assando Sites* - Curso online de *CakePHP*
assando-sites.com.br 

thiagobelem.net
cont...@thiagobelem.net

*Skype / gTalk **»* thiago.belem.web
*LinkedIn* *»* br.linkedin.com/in/thiagobelem/pt


On Mon, Feb 25, 2013 at 7:39 AM, Paul Wiegers  wrote:

> Dear Bakers,
>
> I'm trying to move a application from Symfony to CakePHP, getting tired of
> the way symfony always seems to be getting in the way instead of helping me
> out to do stuff quickly. Of course, I read the docs etc, and now I am
> trying my first baby-steps in Cake.
>
> I have a existing database, which of course comes from the symfony-version
> of my app.
>
> Now, I am trying to bake the CRUD for the database, just to see if things
> can work out without too much changes.
>
> I ran
>
> php bake model all
> php bake controller all
>
> without much trouble, and magic appears to be happening. But with bake
> view all, I hit a snag:
>
> Error: Table subjects for model Subject was not found in datasource
> default.
>
> The strange thing is: I have no Subject model (as far as I can see..) I
> sure don't have a table called subject, I don't even have a field called
> subject. Why is cake thinking I want a subject? I don't want a subject!
> :-)))
>
> My question: how can I find out where this Subject is comming from?
>
> BTW: I used the cake oAuth-app as groundwork for this app, as I want to
> use oAuth.
>
> thanks for any light on this :)
>
> Paul
>
> --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to cake-php+unsubscr...@googlegroups.com.
> To post to this group, send email to cake-php@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Inner Join cakephp

2013-02-25 Thread bau


I have these 2 tables: cd_biblio (which contains a list of books) and 
cd_bibliotem (which contains only the id of book and id of tag).
I want to make a query where the user can choose also the tag of a book (in 
both tables the tags are numeric).
In the cd_biblios controller I add:

App::import('Model', 'CdBibliotem');$CdBibliotem = new CdBibliotem();

I made the queries for cd_biblio table in this way:

// General query$conditions = array(
'editore LIKE' => "%$e%",
'titolo LIKE' => "%$t%");

And then for example: 

if (!$anno)
$conditions[] = array('anno <=' => "$anno2");  if (!$anno2)
$conditions[] = array('anno >=' => "$anno");

Or: 

if (isset($menu)&&$menu!='')
$conditions[]=array('classe LIKE' => "%$menu%");

Now I need to do a inner join between these 2 tables to get all the books 
with a specific tags. 
I save tags in string, so I use: 
SELECT ... WHERE tags IN ('$tags'); 
But I can't make a inner join using $conditions. 

I tried something like this: 

$tem = $CdBibliotem->query("SELECT * FROM cd_biblio INNER JOIN cd_bibliotem ON 
cd_biblio.codiceBiblio = cd_bibliotem.codiceBiblio WHERE codiceTematica IN 
('$tematiche')"); $tem = Set::extract($tem, 
'{n}.cd_biblio');$conditions[]=array('cd_biblio.codiceBiblio IN (?)' => 
'$tem'); 

But it's not working. (I'm using ver 1.2)

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Model "Subject" not found

2013-02-25 Thread Paul Wiegers
Dear Bakers,

I'm trying to move a application from Symfony to CakePHP, getting tired of 
the way symfony always seems to be getting in the way instead of helping me 
out to do stuff quickly. Of course, I read the docs etc, and now I am 
trying my first baby-steps in Cake.

I have a existing database, which of course comes from the symfony-version 
of my app.

Now, I am trying to bake the CRUD for the database, just to see if things 
can work out without too much changes.

I ran

php bake model all
php bake controller all

without much trouble, and magic appears to be happening. But with bake view 
all, I hit a snag:

Error: Table subjects for model Subject was not found in datasource default.

The strange thing is: I have no Subject model (as far as I can see..) I 
sure don't have a table called subject, I don't even have a field called 
subject. Why is cake thinking I want a subject? I don't want a subject! 
:-)))

My question: how can I find out where this Subject is comming from?

BTW: I used the cake oAuth-app as groundwork for this app, as I want to use 
oAuth.

thanks for any light on this :)

Paul

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: language translater

2013-02-25 Thread vishalc29
i found this but dont know how to use this



FromLang = 'he'; 
$google->ToLang = 'en'; 
echo $google->translate('×©×œ×•×  ×¢×•×œ× !'); 
$google->DebugMsg //Gets all error messages 
$google->DebugStatus //Gets all status codes, 200 = ok, 400 = Invalid languages 

?> 
  
FromLang = 'he'; 
//$google->ToLang = 'en'; 
//echo $google->translate('×©×œ×•×  ×¢×•×œ× !'); 
//API version might change, so change $Version if needed 
//$google->DebugMsg //Gets all error messages 
//$google->DebugStatus //Gets all status codes, 200 = ok, 400 = Invalid 
languages 


var $BaseUrl = 
'http://ajax.googleapis.com/ajax/services/language/translate'; 
var $FromLang = 'he'; 
var $ToLang = 'en'; 
var $Version = '1.0'; 

var $CallUrl; 

var $Text = '×©×œ×•×  ×¢×•×œ× !'; 

var $TranslatedText; 
var $DebugMsg; 
var $DebugStatus; 

function makeCallUrl(){ 
$this->CallUrl = $this->BaseUrl; 
$this->CallUrl .= "?v=" . $this->Version; 
$this->CallUrl .= "&q=" . urlencode($this->Text); 
$this->CallUrl .= "&langpair=" . $this->FromLang; 
$this->CallUrl .= "%7C" . $this->ToLang; 
} 

function translate($text = ''){ 
if($text != ''){ 
$this->Text = $text; 
} 
$this->makeCallUrl(); 
if($this->Text != '' && $this->CallUrl != ''){ 
$handle = fopen($this->CallUrl, "rb"); 
$contents = ''; 
while (!feof($handle)) { 
$contents .= fread($handle, 8192); 
} 
fclose($handle); 

$json = json_decode($contents, true); 

if($json['responseStatus'] == 200){ //If request was ok 
$this->TranslatedText = $json['responseData'][
'translatedText']; 
$this->DebugMsg = $json['responseDetails']; 
$this->DebugStatus = $json['responseStatus']; 
return $this->TranslatedText; 
} else { //Return some errors 
return false; 
$this->DebugMsg = $json['responseDetails']; 
$this->DebugStatus = $json['responseStatus']; 
} 
} else { 
return false; 
} 
} 
}//END OF CLASS 
?> 
 
 

>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: language translater

2013-02-25 Thread vishalc29


i want to use google language translater.  how i can use..?
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Best way to retriving api and webservice data

2013-02-25 Thread Tony Messias
Look the 1.3 example (twitter):

http://book.cakephp.org/1.3/en/The-Manual/Developing-with-CakePHP/DataSources.html#an-example

and the 2.x:

http://book.cakephp.org/2.0/en/models/datasources.html#an-example

You'll basically use HttpSocket to "talk" to the webserver, see:

http://book.cakephp.org/2.0/en/core-utility-libraries/httpsocket.html#httpsocket

Att,


--

Luiz Antonio S Messias
Desenvolvedor Web


@tonyzrp 
*LinkedIn* 


On 25 February 2013 06:54, Mathias R  wrote:

> Hi,
>
> thx for your answer. I read about datasources too but i don't know how to
> work with.
> i want to access data from xml-, json- and/or soap-webservices.
>
> M.
>
> Am Montag, 25. Februar 2013 04:04:35 UTC+1 schrieb Tony:
>>
>> I've never used (and I would like to), but I believe it would be the case
>> of using/creating *DataSources:*
>> *
>> *
>> http://book.cakephp.org/2.0/**en/models/datasources.html
>> *
>> *
>>
>> Att,
>>
>>
>> --
>>
>> Luiz Antonio S Messias
>> Desenvolvedor Web
>>
>> 
>> @tonyzrp 
>> *LinkedIn* 
>>
>>
>> On 24 February 2013 17:23, Mathias R  wrote:
>>
>>>  Hi,
>>>
>>> i'm creating an app which is need to get data from multiple api sources.
>>> fo each source i wan't to create an own plugin. That's my idea.
>>>
>>> which way is the best to access an api or webservice?
>>> Creating a Model without table and access webservice with it's methods?
>>>
>>> hope u understand my terrible english ;)
>>>
>>> Greetings
>>>
>>> M.
>>>
>>> --
>>> Like Us on FaceBook 
>>> https://www.facebook.com/**CakePHP
>>> Find us on Twitter http://twitter.com/CakePHP
>>>
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "CakePHP" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to cake-php+u...@**googlegroups.com.
>>> To post to this group, send email to cake...@googlegroups.com.
>>>
>>> Visit this group at 
>>> http://groups.google.com/**group/cake-php?hl=en
>>> .
>>> For more options, visit 
>>> https://groups.google.com/**groups/opt_out
>>> .
>>>
>>>
>>>
>>
>>  --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to cake-php+unsubscr...@googlegroups.com.
> To post to this group, send email to cake-php@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Fixture for the model of a HABTM relationship generates invalid SQL

2013-02-25 Thread marcus33cz
Ok so I guess I found the solution for this...

Before I was getting this error:

>
>Warning: array_map(): An error occurred while invoking the map 
>callback in 
>/var/www/clients/client0/web29/web/lib/Cake/Model/Datasource/DboSource.php 
>on line 451 Warning: Fixture creation for "matches_teams" failed 
>"SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error 
>in your SQL syntax; check the manual that corresponds to your MySQL server 
>version for the right syntax to use near ''0=home' at line 4" in 
>
> /var/www/clients/client0/web29/web/lib/Cake/TestSuite/Fixture/CakeTestFixture.php
>  
>on line 210
>
>
And below that another error:

> Error: SQLSTATE[42S02]: Base table or view not found: 1146 Table 
> 'c0tipmastertest.matches_teams' doesn't exist 


In my fixture I had:

class MatchesTeamFixture extends CakeTestFixture {
> /**
>  * Fields
>  *
>  * @var array
>  */
> public $fields = array(
> 'match_id' => array('type' => 'integer', 'null' => false, 'default' => 
> null),
> 'team_id' => array('type' => 'integer', 'null' => false, 'default' => 
> null),
> 'home_away' => array('type' => 'integer', 'null' => false, 'default' => 
> null, 'length' => 4, 'key' => 'index', 'comment' => '0=home;1=away'),
> 'id' => array('type' => 'integer', 'null' => false, 'default' => null, 
> 'length' => 10, 'key' => 'primary'),
> 'indexes' => array(
> 'PRIMARY' => array('column' => 'id', 'unique' => 1),
> 'home_away' => array('column' => 'home_away', 'unique' => 0)
> ),
> 'tableParameters' => array('charset' => 'utf8', 'collate' => 
> 'utf8_general_ci', 'engine' => 'MyISAM')
> );  

 (...)

So I just accidentally tried removing some stuff and removing the semicolon 
from the *comment *attribute worked:

>  class MatchesTeamFixture extends CakeTestFixture {
> /**
>  * Fields
>  *
>  * @var array
>  */
> public $fields = array(
> 'match_id' => array('type' => 'integer', 'null' => false, 'default' => 
> null),
> 'team_id' => array('type' => 'integer', 'null' => false, 'default' => 
> null),
> 'home_away' => array('type' => 'integer', 'null' => false, 'default' => 
> null, 'length' => 4, 'key' => 'index'),
> 'id' => array('type' => 'integer', 'null' => false, 'default' => null, 
> 'length' => 10, 'key' => 'primary'),
> 'indexes' => array(
> 'PRIMARY' => array('column' => 'id', 'unique' => 1),
> 'home_away' => array('column' => 'home_away', 'unique' => 0)
> ),
> 'tableParameters' => array('charset' => 'utf8', 'collate' => 
> 'utf8_general_ci', 'engine' => 'MyISAM')
> );


So I guess CakePHP doesn't escape the comment values. 

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Fixture for the model of a HABTM relationship generates invalid SQL

2013-02-25 Thread marcus33cz
Hi Andrew,

I'm having exactly the same problem.. I have a HABTM relationship between 
(sports) matches and teams. When I try to create a fixture for the 
MatchesTeam class I get the same error:
*Error: *SQLSTATE[42S02]: Base table or view not found: 1146 Table 
'c0test.matches_teams' doesn't exist 

I have no idea how to repair this because all other fixtures work 
perfectly...

*cricket: *I'm sorry but you don't understand what the problem is. The 
author doesn't set the AUTO INCREMENT twice intentionally. CakePHP does 
this on its own. I have a single-column primary key (named id) and I still 
get this error.
I tried both importing the fixture data from my original table and 
generating them manually and no matter what I do the table (matches_teams) 
is not created.

Dne pondělí, 31. prosince 2012 14:32:15 UTC+1 pyr...@googlemail.com 
napsal(a):
>
> Hey,
>
> I'm having a slight issue with a fixture I'm attempting to create.
>
> Basically I have a Member model and a Group model, and they have a HABTM 
> relationship, I've specified a custom model to handle this relationship 
> 'GroupsMember' as I wish to add methods to that model to query the join 
> table directly.
>
> So when I set this table up in the databse (I use MySQL) I set it up like 
> this:
>
> CREATE 
> TABLE
>  
> IF
>  
> NOT
>  
> EXISTS `member_group` (
> `member_id` 
> int
> ( 11 ) 
> NOT
>  
> NULL ,
> `grp_id` 
> int
> ( 11 ) 
> NOT
>  
> NULL ,
> PRIMARY KEY ( `member_id` , `grp_id` ) 
> ) ENGINE 
> =
>  
> InnoDB DEFAULT 
> CHARSET
>  
> =
>  
> latin1;
>
> This was all working ok until I attempted to create a fixture for the 
> 'GroupsMember' model. The code I use to do that is as follows:
>
> class GroupsMemberFixture extends CakeTestFixture 
> {
> public $useDbConfig = 'test';
> public $table = 'member_group';
>
> public $fields = array(
>  'member_id' => array('type' => 'integer', 'null' => false, 'key' 
> => 'primary'),
>  'grp_id' => array('type' => 'integer', 'null' => false, 'key' => 
> 'primary'),
>   );
>
> public $records = array(
> array('member_id' => 0, 'grp_id' => 1),
> );
> }
>
> However, when I run the test I get the following error:
> SQLSTATE[42S02]: Base table or view not found: 1146 Table 
> 'instrumentation_test.member_group' doesn't exist
>
> So I decided to log all the SQL queries being generated, and the last one 
> is this:
>
> CREATE TABLE `instrumentation_test`.`member_group` (
> `member_id` int(11) NOT NULL AUTO_INCREMENT,
> `grp_id` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY  (`grp_id`)) 
> ENGINE=MEMORY;
>
> If I run that in phpMyAdmin then it fails with the following error:
>
> #1075 - Incorrect table definition; there can be only one auto column and 
> it must be defined as a key
>
> So the addition of the AUTO_INCREMENT is messing things up, and the 
> primary key is only set to be the grp_id not both the grp_id and the 
> members_id.
>
> Is there any-way I can override the SQL cake is generating for this case?
>
> If I change it so that I create the table in the test database and tell 
> the fixture to import the structure from there (using public $import = 
> 'GroupsMember';) then cake generates the following SQL:
>
> CREATE TABLE `instrumentation_test`.`member_group` (
> `member_id` int(11) NOT NULL AUTO_INCREMENT,

problem with very basic Twitter datasource example from CakePHP book

2013-02-25 Thread Arjen Voogt
Hi,

Yes. I am a newbie. Working with CakePHP is a joy! But I am running into a 
little problem. I've implemented the Twitter datasource example from the 
CakePHP book 
(http://book.cakephp.org/1.3/en/The-Manual/Developing-with-CakePHP/DataSources.html#an-example).
 
No typos or omissions, but I get an error: 

Error: Call to a member function find() on a non-object 
File: /Users//Sites/app/Controller/CommentsController.php 
Line: 30

On line 30: $tweets = $this->Tweet->find('all');

Can anybody shine a light on this? Thanks in advance!!!

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




cakephp 2 disabled cache after save

2013-02-25 Thread Lolalola
Hi,
after insert or delete i don't wish delete view cache, but cake do it 
automatically. How disabled clear cache after save, delete functions?

My try, but still the same:

if($this->User->save($data, array('callbacks' => false)))

 
Thanks

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Best way to retriving api and webservice data

2013-02-25 Thread Mathias R
Hi,

thx for your answer. I read about datasources too but i don't know how to 
work with.
i want to access data from xml-, json- and/or soap-webservices.

M.

Am Montag, 25. Februar 2013 04:04:35 UTC+1 schrieb Tony:
>
> I've never used (and I would like to), but I believe it would be the case 
> of using/creating *DataSources:*
> *
> *
> http://book.cakephp.org/2.0/en/models/datasources.html*
> *
>
> Att,
>
>
> --
>
> Luiz Antonio S Messias
> Desenvolvedor Web
>
> 
> @tonyzrp 
> *LinkedIn* 
>  
>
> On 24 February 2013 17:23, Mathias R  >wrote:
>
>> Hi,
>>
>> i'm creating an app which is need to get data from multiple api sources.
>> fo each source i wan't to create an own plugin. That's my idea.
>>
>> which way is the best to access an api or webservice?
>> Creating a Model without table and access webservice with it's methods?
>>
>> hope u understand my terrible english ;)
>>
>> Greetings
>> M.
>>
>> -- 
>> Like Us on FaceBook https://www.facebook.com/CakePHP
>> Find us on Twitter http://twitter.com/CakePHP
>>  
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "CakePHP" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to cake-php+u...@googlegroups.com .
>> To post to this group, send email to cake...@googlegroups.com
>> .
>> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>  
>>  
>>
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.