Re: ma a newbie - want to know how to install and create my first app..

2008-07-13 Thread Easter Egg

You can start with book.cakephp.org, and search google for "cakephp
blog tutorial"!

be more specific, I do whatever I can.

On Jul 13, 11:08 am, xelios <[EMAIL PROTECTED]> wrote:
> ma a newbie - want to know how to install and create my first app..
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: HABTM findAll problem

2007-07-05 Thread Easter Egg

O'Brothers!

It worked, thank you all.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: HABTM findAll problem

2007-07-03 Thread Easter Egg

About seeing that (6) product item, I see that too, but this the
problem that it won't get into $data variable, and I have this problem
with $hasMany association, it is better to say that I just receive 5
item per model, and I don't know why.

about HABTM pagination, thank you! I will looking forward it.

Regards


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: HABTM findAll problem

2007-07-03 Thread Easter Egg
oops! wrong message, let me show another tag.id that contains more
that 5 result:

5   SELECT `Product`.`id`, `Product`.`name`, `Product`.`altname`,
`Product`.`description`, `Product`.`year`, `Product`.`price`,
`Product`.`quantity`, `Product`.`small_image`, `Product`.`big_image`
FROM `products` AS `Product` JOIN `products_tags` ON
(`products_tags`.`tag_id` = 3 AND `products_tags`.`product_id` =
`Product`.`id`) WHERE 1 = 1 6   6   1

this query will return 6 item, but I cannot access them, I just see
that $data is this:

Array
(
[0] => Array
(
[Tag] => Array
(
[id] => 3
[name] => مهییج
)

[Product] => Array
(
[0] => Array
(
[id] => 3
[name] => توازن
[altname] => Equilibrium
[description] => توازن فیلمی است علمی-
تخیلی، در باب نظم جهان و دنیایی از آینده که در آن بشریت بالاجبار به
نظام‌های سخت اجتماعی پناه برده است.
[year] => 2001
[price] => 750
[quantity] => 1
[small_image] => winter.jpg
[big_image] => sunset.jpg
)

[1] => Array
(
[id] => 4
[name] => ماتریکس
[altname] => Matrix
[description] => فیلم قشنگیه! حال کنین!
[year] => 2001
[price] => 800
[quantity] => 1
[small_image] => blood_and_chocolate.jpg
[big_image] =>
madonna_confessions_tour.jpg
)

[2] => Array
(
[id] => 5
[name] => ناچو لیبره
[altname] => Nacho Libre
[description] => فیلمی مهیج، با بازی
بازیگران کمدی
[year] => 1999
[price] => 780
[quantity] => 1
[small_image] => blood_and_chocolate.jpg
[big_image] =>
arthur_and_the_invisibles.jpg
)

[3] => Array
(
[id] => 8
[name] => کوزه‌ی سفالی
[altname] => The Pottery
[description] => جیمز در آغاز با کوزه گری
شروع می‌کند،اما در آینده به قهرمانی بدل می‌شود که کشورش را نجات
می‌دهد.
[year] => 2007
[price] => 750
[quantity] => 1
[small_image] => if_only.jpg
[big_image] => little_children.jpg
)

[4] => Array
(
[id] => 17
[name] => ماتریکس 2
[altname] => شسی
[description] => شسیشسی
[year] => 2001
[price] => 200
[quantity] => 1
[small_image] =>
[big_image] =>
)

[5] => Array
(
[id] => 18
[name] => اسپایدرمن 3
[altname] => Spiderman 3
[description] => fileasdasdasdad
[year] => 2004
[price] => 750
[quantity] => 1
[small_image] => hannibal_rising.jpg
[big_image] =>
lost_cover_s2p1__naboo_qwerty_.jpg
)

)

)

)

so, where is the sixth item? I don't know.

I used 1.1.15.5144 .

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: HABTM findAll problem

2007-07-03 Thread Easter Egg

function view($id) {
$criteria= "Tag.id = {$id}";
list($order,$limit,$page) = $this->Pagination->init($criteria,
null, array('sortBy' => 'id DESC')); // Added
$data = $this->Tag->findAll($criteria, NULL, $order, $limit,
$page); // Extra parameters added
$this->set('data', $data);
}

for your more info, I turned on debugging system and recieved this
details:

Nr  Query   Error   AffectedNum. rows   Took (ms)
1   DESCRIBE `tags` 2   2   2
2   DESCRIBE `products` 9   9   2
3   SELECT COUNT(*) AS count FROM `tags` AS `Tag` WHERE `Tag`.`id` = 4
1   1   0
4   SELECT `Tag`.`id`, `Tag`.`name` FROM `tags` AS `Tag` WHERE
`Tag`.`id` = 4 ORDER BY `Tag`.`id` DESC LIMIT 201   1   0
5   SELECT `Product`.`id`, `Product`.`name`, `Product`.`altname`,
`Product`.`description`, `Product`.`year`, `Product`.`price`,
`Product`.`quantity`, `Product`.`small_image`, `Product`.`big_image`
FROM `products` AS `Product` JOIN `products_tags` ON
(`products_tags`.`tag_id` = 4 AND `products_tags`.`product_id` =
`Product`.`id`) WHERE 1 = 1 4   4   1
6   SELECT Tag.`name`, Tag.`id` , COUNT( P.`product_id` ) count FROM
`tags` Tag, `products_tags` P WHERE Tag.id = P.`tag_id` GROUP BY
Tag.id  8   8   1


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



HABTM findAll problem

2007-07-03 Thread Easter Egg

Hi all,
I used a HABTM over Product and Tag.

// TAG.PHP


   array('className'=> 'Product',
 'joinTable'=>
'products_tags',
 'foreignKey'   => 'tag_id',
 'associationForeignKey'=>
'product_id',
 'conditions'   => '',
 'order'=> '',
 'limit'=> '',
 'unique'   => true,
 'finderQuery'  => '',
 'deleteQuery'  => '',
   )
   );
}
?>


// PRODUCT.PHP


   array('className'=> 'Tag',
 'joinTable'=>
'products_tags',
 'foreignKey'   => 'product_id',
 'associationForeignKey'=>
'tag_id',
 'conditions'   => '',
 'order'=> '',
 'limit'=> '',
 'unique'   => true,
 'finderQuery'  => '',
 'deleteQuery'  => '',
   )
   );
var $validate = array (
"name"  =>  VALID_NOT_EMPTY,
"year"  =>  VALID_YEAR,
"price" =>  VALID_NUMBER,
"quantity"  =>  VALID_NUMBER,
"description"=> VALID_NOT_EMPTY);
}
?>

I defined a function view($id) that return all products of a single
tag. but it only and only recieve the first 5 products over that
query. like this:
Array
(
[0] => Array
(
[Tag] => Array
(
[id] => 3
[name] => مهییج
)

[Product] => Array
(
[0] => Array
(
[id] => 3
[name] => توازن
[altname] => Equilibrium
[description] => توازن فیلمی است علمی-
تخیلی، در باب نظم جهان و دنیایی از آینده که در آن بشریت بالاجبار به
نظام‌های سخت اجتماعی پناه برده است.
[year] => 2001
[price] => 750
[quantity] => 1
[small_image] => winter.jpg
[big_image] => sunset.jpg
)

[1] => Array
(
[id] => 4
[name] => ماتریکس
[altname] => Matrix
[description] => فیلم قشنگیه! حال کنین!
[year] => 2001
[price] => 800
[quantity] => 1
[small_image] => blood_and_chocolate.jpg
[big_image] =>
madonna_confessions_tour.jpg
)

[2] => Array
(
[id] => 5
[name] => ناچو لیبره
[altname] => Nacho Libre
[description] => فیلمی مهیج، با بازی
بازیگران کمدی
[year] => 1999
[price] => 780
[quantity] => 1
[small_image] => blood_and_chocolate.jpg
[big_image] =>
arthur_and_the_invisibles.jpg
)

[3] => Array
(
[id] => 8
[name] => کوزه‌ی سفالی
[altname] => The Pottery
[description] => جیمز در آغاز با کوزه گری
شروع می‌کند،اما در آینده به قهرمانی بدل می‌شود که کشورش را نجات
می‌دهد.
[year] => 2007
[price] => 750
[quantity] => 1
[small_image] => if_only.jpg
[big_image] => little_children.jpg
)

[4] => Array
(
[id] => 17
[name] => ماتریکس 2
[altname] => شسی
[description] => شسیشسی
[year] => 2001
[price] => 200
[quantity] => 1
[small_image] =>
[big_image]