@@ -250,6 +250,7 @@ discard block |
||
250 | 250 | * Formats array to return from product list from Doctrine |
251 | 251 | * |
252 | 252 | * @param object $doctrine_products Doctrine_Collection |
253 | + * @param integer $attribute_id |
|
253 | 254 | * @return array with products |
254 | 255 | */ |
255 | 256 | private function createDoctrineProductsListArray($doctrine_products, $attribute_id = null) |
@@ -563,7 +564,6 @@ discard block |
||
563 | 564 | * |
564 | 565 | * @param struct $credentials Credentials to use the server |
565 | 566 | * @param integer $shop_id Id for the shop |
566 | - * @param integer $id Product id |
|
567 | 567 | * |
568 | 568 | * @return array |
569 | 569 | */ |
@@ -741,7 +741,7 @@ discard block |
||
741 | 741 | * |
742 | 742 | * @param struct $credentials Credentials to use the server |
743 | 743 | * @param integer $shop_id Id for the shop |
744 | - * @param integer $produt_id Product id to add |
|
744 | + * @param integer $product_id Product id to add |
|
745 | 745 | * @param integer $product_variation_id Product variation id to change |
746 | 746 | * @param integer $quantity Optional quantity |
747 | 747 | * @param string $text Extra text to the itemline |
@@ -784,7 +784,7 @@ discard block |
||
784 | 784 | * @param string $text Extra text to the itemline |
785 | 785 | * @param integer $product_detail_id Product detail id |
786 | 786 | * |
787 | - * @return mixed |
|
787 | + * @return boolean |
|
788 | 788 | */ |
789 | 789 | public function changeProductInBasket($credentials, $shop_id, $product_id, $product_variation_id, $quantity, $text = '', $product_detail_id = 0) |
790 | 790 | { |
@@ -1238,6 +1238,7 @@ discard block |
||
1238 | 1238 | /** |
1239 | 1239 | * Initialize the webshop |
1240 | 1240 | * |
1241 | + * @param integer $shop_id |
|
1241 | 1242 | * @return void |
1242 | 1243 | */ |
1243 | 1244 | private function _factoryWebshop($shop_id) |
@@ -590,7 +590,7 @@ discard block |
||
590 | 590 | return $this->prepareResponseData($this->cleanUpProductList($product->getRelatedProducts($currencies, 'webshop'))); |
591 | 591 | } |
592 | 592 | |
593 | - /** |
|
593 | + /** |
|
594 | 594 | * Gets featured products |
595 | 595 | * |
596 | 596 | * Method is experimental and only used by discimport.dk. If you need to use it |
@@ -641,7 +641,7 @@ discard block |
||
641 | 641 | |
642 | 642 | } |
643 | 643 | |
644 | - /** |
|
644 | + /** |
|
645 | 645 | * Gets product keywords which can be used to sort ones webshop |
646 | 646 | * |
647 | 647 | * |
@@ -74,40 +74,40 @@ discard block |
||
74 | 74 | } |
75 | 75 | |
76 | 76 | // sublevel has to be used so other searches are not overwritten |
77 | - $product->getDBQuery()->storeResult('use_stored', 'webshop_' . $area . '_' . md5($this->credentials['session_id']), 'sublevel'); |
|
77 | + $product->getDBQuery()->storeResult('use_stored', 'webshop_'.$area.'_'.md5($this->credentials['session_id']), 'sublevel'); |
|
78 | 78 | $debug2 = serialize($mixed); |
79 | 79 | if (isset($mixed['offset']) and is_numeric($mixed['offset']) and $mixed['offset'] > 0) { |
80 | 80 | $product->getDBQuery()->useStored(true); |
81 | 81 | $product->getDBQuery()->setPagingOffset((int)$mixed['offset']); |
82 | - $debug2 .= 'offset ' . $mixed['offset']; |
|
82 | + $debug2 .= 'offset '.$mixed['offset']; |
|
83 | 83 | } elseif (isset($mixed['use_stored']) and array_key_exists('use_stored', $mixed) and $mixed['use_stored'] == 'true') { |
84 | 84 | $product->getDBQuery()->useStored(true); |
85 | 85 | $debug2 .= 'use_stored true'; |
86 | 86 | } else { |
87 | 87 | if (array_key_exists('search', $mixed) and !empty($mixed['search'])) { |
88 | 88 | $product->getDBQuery()->setFilter('search', $mixed['search']); |
89 | - $debug2 .= 'search ' . $mixed['search']; |
|
89 | + $debug2 .= 'search '.$mixed['search']; |
|
90 | 90 | } |
91 | 91 | |
92 | 92 | if (array_key_exists('keywords', $mixed) and !empty($mixed['keywords'])) { |
93 | 93 | $product->getDBQuery()->setFilter('keywords', $mixed['keywords']); |
94 | - $debug2 .= 'keyword ' . $mixed['keywords']; |
|
94 | + $debug2 .= 'keyword '.$mixed['keywords']; |
|
95 | 95 | } |
96 | 96 | |
97 | 97 | if (array_key_exists('category', $mixed) and !empty($mixed['category'])) { |
98 | 98 | $product->getDBQuery()->setFilter('shop_id', $shop_id); |
99 | 99 | $product->getDBQuery()->setFilter('category', $mixed['category']); |
100 | - $debug2 .= 'category ' . $mixed['category']; |
|
100 | + $debug2 .= 'category '.$mixed['category']; |
|
101 | 101 | } |
102 | 102 | |
103 | 103 | if (isset($mixed['ids']) and array_key_exists('ids', $mixed) and is_array($mixed['ids'])) { |
104 | 104 | $product->getDBQuery()->setFilter('ids', $mixed['ids']); |
105 | - $debug2 .= 'ids ' . implode(', ', $mixed['ids']); |
|
105 | + $debug2 .= 'ids '.implode(', ', $mixed['ids']); |
|
106 | 106 | } |
107 | 107 | |
108 | 108 | if (array_key_exists('sorting', $mixed) and !empty($mixed['sorting'])) { |
109 | 109 | $product->getDBQuery()->setFilter('sorting', $mixed['sorting']); |
110 | - $debug2 .= 'sorting ' . $mixed['sorting']; |
|
110 | + $debug2 .= 'sorting '.$mixed['sorting']; |
|
111 | 111 | } |
112 | 112 | } |
113 | 113 | |
@@ -613,7 +613,7 @@ discard block |
||
613 | 613 | |
614 | 614 | if (PEAR::isError($db)) { |
615 | 615 | require_once 'XML/RPC2/Exception.php'; |
616 | - throw new XML_RPC2_FaultException($db->getMessage() . $db->getUserInfo(), -1); |
|
616 | + throw new XML_RPC2_FaultException($db->getMessage().$db->getUserInfo(), -1); |
|
617 | 617 | } |
618 | 618 | |
619 | 619 | $featured = new Intraface_modules_shop_FeaturedProducts($this->kernel->intranet, $this->webshop->getShop(), $db); |
@@ -878,7 +878,7 @@ discard block |
||
878 | 878 | |
879 | 879 | if (!$order_id = $this->webshop->placeOrder($values)) { |
880 | 880 | require_once 'XML/RPC2/Exception.php'; |
881 | - throw new XML_RPC2_FaultException('order could not be placed. It returned the following error: ' . strtolower(implode(', ', $this->webshop->error->getMessage())), -4); |
|
881 | + throw new XML_RPC2_FaultException('order could not be placed. It returned the following error: '.strtolower(implode(', ', $this->webshop->error->getMessage())), -4); |
|
882 | 882 | } |
883 | 883 | |
884 | 884 | return $this->prepareResponseData($this->webshop->getOrderIdentifierKey()); |
@@ -908,7 +908,7 @@ discard block |
||
908 | 908 | |
909 | 909 | if (!$this->webshop->getBasket()->saveAddress($values)) { |
910 | 910 | require_once 'XML/RPC2/Exception.php'; |
911 | - throw new XML_RPC2_FaultException('datails could not be saved ' . strtolower(implode(', ', $this->webshop->error->getMessage())), -4); |
|
911 | + throw new XML_RPC2_FaultException('datails could not be saved '.strtolower(implode(', ', $this->webshop->error->getMessage())), -4); |
|
912 | 912 | } |
913 | 913 | |
914 | 914 | return $this->prepareResponseData(true); |
@@ -949,7 +949,7 @@ discard block |
||
949 | 949 | $customer_coupon = $this->processRequestData($customer_coupon); |
950 | 950 | if (!$this->webshop->getBasket()->saveCustomerCoupon($customer_coupon)) { |
951 | 951 | require_once 'XML/RPC2/Exception.php'; |
952 | - throw new XML_RPC2_FaultException('datails could not be saved ' . strtolower(implode(', ', $this->webshop->error->getMessage())), -4); |
|
952 | + throw new XML_RPC2_FaultException('datails could not be saved '.strtolower(implode(', ', $this->webshop->error->getMessage())), -4); |
|
953 | 953 | } |
954 | 954 | |
955 | 955 | return $this->prepareResponseData(true); |
@@ -990,7 +990,7 @@ discard block |
||
990 | 990 | $customer_ean = $this->processRequestData($customer_ean); |
991 | 991 | if (!$this->webshop->getBasket()->saveCustomerEan($customer_ean)) { |
992 | 992 | require_once 'XML/RPC2/Exception.php'; |
993 | - throw new XML_RPC2_FaultException('ean could not be saved ' . strtolower(implode(', ', $this->webshop->error->getMessage())), -4); |
|
993 | + throw new XML_RPC2_FaultException('ean could not be saved '.strtolower(implode(', ', $this->webshop->error->getMessage())), -4); |
|
994 | 994 | } |
995 | 995 | |
996 | 996 | return $this->prepareResponseData(true); |
@@ -1032,7 +1032,7 @@ discard block |
||
1032 | 1032 | $customer_comment = $this->processRequestData($customer_comment); |
1033 | 1033 | if (!$this->webshop->getBasket()->saveCustomerComment($customer_comment)) { |
1034 | 1034 | require_once 'XML/RPC2/Exception.php'; |
1035 | - throw new XML_RPC2_FaultException('datails could not be saved ' . strtolower(implode(', ', $this->webshop->error->getMessage())), -4); |
|
1035 | + throw new XML_RPC2_FaultException('datails could not be saved '.strtolower(implode(', ', $this->webshop->error->getMessage())), -4); |
|
1036 | 1036 | } |
1037 | 1037 | |
1038 | 1038 | return $this->prepareResponseData(true); |
@@ -1091,7 +1091,7 @@ discard block |
||
1091 | 1091 | $payment_method = $this->processRequestData($payment_method); |
1092 | 1092 | if (!$this->webshop->getBasket()->savePaymentMethod($payment_method)) { |
1093 | 1093 | require_once 'XML/RPC2/Exception.php'; |
1094 | - throw new XML_RPC2_FaultException('datails could not be saved ' . strtolower(implode(', ', $this->webshop->error->getMessage())), -4); |
|
1094 | + throw new XML_RPC2_FaultException('datails could not be saved '.strtolower(implode(', ', $this->webshop->error->getMessage())), -4); |
|
1095 | 1095 | } |
1096 | 1096 | |
1097 | 1097 | return $this->prepareResponseData(true); |
@@ -212,7 +212,6 @@ discard block |
||
212 | 212 | * |
213 | 213 | * @param struct $credentials Credentials to use the server |
214 | 214 | * @param integer $shop_id Id for the shop |
215 | - * @param integer $id Product id |
|
216 | 215 | * |
217 | 216 | * @return array |
218 | 217 | */ |
@@ -328,7 +327,7 @@ discard block |
||
328 | 327 | * |
329 | 328 | * @param struct $credentials Credentials to use the server |
330 | 329 | * @param integer $shop_id Id for the shop |
331 | - * @param integer $produt_id Product id to add |
|
330 | + * @param integer $product_id Product id to add |
|
332 | 331 | * @param integer $product_variation_id Product variation id to change |
333 | 332 | * @param integer $quantity Optional quantity |
334 | 333 | * @param string $text Extra text to the itemline |
@@ -371,7 +370,7 @@ discard block |
||
371 | 370 | * @param string $text Extra text to the itemline |
372 | 371 | * @param integer $product_detail_id Product detail id |
373 | 372 | * |
374 | - * @return mixed |
|
373 | + * @return boolean |
|
375 | 374 | */ |
376 | 375 | public function changeProductInBasket($credentials, $shop_id, $product_id, $product_variation_id, $quantity, $text = '', $product_detail_id = 0) |
377 | 376 | { |
@@ -791,6 +790,7 @@ discard block |
||
791 | 790 | /** |
792 | 791 | * Initialize the webshop |
793 | 792 | * |
793 | + * @param integer $shop_id |
|
794 | 794 | * @return void |
795 | 795 | */ |
796 | 796 | private function _factoryWebshop($shop_id) |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | return $this->prepareResponseData($product->getRelatedProducts()); |
234 | 234 | } |
235 | 235 | |
236 | - /** |
|
236 | + /** |
|
237 | 237 | * Gets featured products |
238 | 238 | * |
239 | 239 | * Method is experimental and only used by discimport.dk. If you need to use it |
@@ -278,7 +278,7 @@ discard block |
||
278 | 278 | |
279 | 279 | } |
280 | 280 | |
281 | - /** |
|
281 | + /** |
|
282 | 282 | * Gets product keywords which can be used to sort ones webshop |
283 | 283 | * |
284 | 284 | * |
@@ -60,40 +60,40 @@ discard block |
||
60 | 60 | |
61 | 61 | |
62 | 62 | // sublevel has to be used so other searches are not overwritten |
63 | - $product->getDBQuery()->storeResult('use_stored', 'webshop_' . $area . '_' . md5($this->credentials['session_id']), 'sublevel'); |
|
63 | + $product->getDBQuery()->storeResult('use_stored', 'webshop_'.$area.'_'.md5($this->credentials['session_id']), 'sublevel'); |
|
64 | 64 | $debug2 = serialize($mixed); |
65 | 65 | if (isset($mixed['offset']) and array_key_exists('offset', $mixed) and is_numeric($mixed['offset'])) { |
66 | 66 | $product->getDBQuery()->useStored(true); |
67 | 67 | $product->getDBQuery()->setPagingOffset((int)$mixed['offset']); |
68 | - $debug2 .= 'offset ' . $mixed['offset']; |
|
68 | + $debug2 .= 'offset '.$mixed['offset']; |
|
69 | 69 | } elseif (isset($mixed['use_stored']) and array_key_exists('use_stored', $mixed) and $mixed['use_stored'] == 'true') { |
70 | 70 | $product->getDBQuery()->useStored(true); |
71 | 71 | $debug2 .= 'use_stored true'; |
72 | 72 | } else { |
73 | 73 | if (array_key_exists('search', $mixed) and !empty($mixed['search'])) { |
74 | 74 | $product->getDBQuery()->setFilter('search', $mixed['search']); |
75 | - $debug2 .= 'search ' . $mixed['search']; |
|
75 | + $debug2 .= 'search '.$mixed['search']; |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | if (array_key_exists('keywords', $mixed) and !empty($mixed['keywords'])) { |
79 | 79 | $product->getDBQuery()->setFilter('keywords', $mixed['keywords']); |
80 | - $debug2 .= 'keyword ' . $mixed['keywords']; |
|
80 | + $debug2 .= 'keyword '.$mixed['keywords']; |
|
81 | 81 | } |
82 | 82 | |
83 | 83 | if (array_key_exists('category', $mixed) and !empty($mixed['category'])) { |
84 | 84 | $product->getDBQuery()->setFilter('shop_id', $shop_id); |
85 | 85 | $product->getDBQuery()->setFilter('category', $mixed['category']); |
86 | - $debug2 .= 'category ' . $mixed['category']; |
|
86 | + $debug2 .= 'category '.$mixed['category']; |
|
87 | 87 | } |
88 | 88 | |
89 | 89 | if (isset($mixed['ids']) and array_key_exists('ids', $mixed) and is_array($mixed['ids'])) { |
90 | 90 | $product->getDBQuery()->setFilter('ids', $mixed['ids']); |
91 | - $debug2 .= 'ids ' . implode(', ', $mixed['ids']); |
|
91 | + $debug2 .= 'ids '.implode(', ', $mixed['ids']); |
|
92 | 92 | } |
93 | 93 | |
94 | 94 | if (array_key_exists('sorting', $mixed) and !empty($mixed['sorting'])) { |
95 | 95 | $product->getDBQuery()->setFilter('sorting', $mixed['sorting']); |
96 | - $debug2 .= 'sorting ' . $mixed['sorting']; |
|
96 | + $debug2 .= 'sorting '.$mixed['sorting']; |
|
97 | 97 | } |
98 | 98 | } |
99 | 99 | |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | 'name' => $variation->getName(), |
197 | 197 | 'attributes' => $attributes_array, |
198 | 198 | 'identifier' => $attribute_string, |
199 | - 'price_incl_vat' => round(($product->get('price') + $detail->getPriceDifference()) * (1 + $product->get('vat_percent')/100), 2), |
|
199 | + 'price_incl_vat' => round(($product->get('price') + $detail->getPriceDifference())*(1 + $product->get('vat_percent')/100), 2), |
|
200 | 200 | 'weight' => $product->get('weight') + $detail->getWeightDifference() |
201 | 201 | ), |
202 | 202 | 'stock' => $variation->getStock($product)->get() |
@@ -256,7 +256,7 @@ discard block |
||
256 | 256 | |
257 | 257 | if (PEAR::isError($db)) { |
258 | 258 | require_once 'XML/RPC2/Exception.php'; |
259 | - throw new XML_RPC2_FaultException($db->getMessage() . $db->getUserInfo(), -1); |
|
259 | + throw new XML_RPC2_FaultException($db->getMessage().$db->getUserInfo(), -1); |
|
260 | 260 | } |
261 | 261 | |
262 | 262 | $featured = new Intraface_modules_shop_FeaturedProducts($this->kernel->intranet, $this->webshop->getShop(), $db); |
@@ -459,7 +459,7 @@ discard block |
||
459 | 459 | |
460 | 460 | if (!$order_id = $this->webshop->placeOrder($values)) { |
461 | 461 | require_once 'XML/RPC2/Exception.php'; |
462 | - throw new XML_RPC2_FaultException('order could not be placed. It returned the following error: ' . strtolower(implode(', ', $this->webshop->error->getMessage())), -4); |
|
462 | + throw new XML_RPC2_FaultException('order could not be placed. It returned the following error: '.strtolower(implode(', ', $this->webshop->error->getMessage())), -4); |
|
463 | 463 | } |
464 | 464 | |
465 | 465 | return $this->prepareResponseData($this->webshop->getOrderIdentifierKey()); |
@@ -489,7 +489,7 @@ discard block |
||
489 | 489 | |
490 | 490 | if (!$this->webshop->getBasket()->saveAddress($values)) { |
491 | 491 | require_once 'XML/RPC2/Exception.php'; |
492 | - throw new XML_RPC2_FaultException('datails could not be saved ' . strtolower(implode(', ', $this->webshop->error->getMessage())), -4); |
|
492 | + throw new XML_RPC2_FaultException('datails could not be saved '.strtolower(implode(', ', $this->webshop->error->getMessage())), -4); |
|
493 | 493 | } |
494 | 494 | |
495 | 495 | return $this->prepareResponseData(true); |
@@ -530,7 +530,7 @@ discard block |
||
530 | 530 | $customer_coupon = $this->processRequestData($customer_coupon); |
531 | 531 | if (!$this->webshop->getBasket()->saveCustomerCoupon($customer_coupon)) { |
532 | 532 | require_once 'XML/RPC2/Exception.php'; |
533 | - throw new XML_RPC2_FaultException('datails could not be saved ' . strtolower(implode(', ', $this->webshop->error->getMessage())), -4); |
|
533 | + throw new XML_RPC2_FaultException('datails could not be saved '.strtolower(implode(', ', $this->webshop->error->getMessage())), -4); |
|
534 | 534 | } |
535 | 535 | |
536 | 536 | return $this->prepareResponseData(true); |
@@ -571,7 +571,7 @@ discard block |
||
571 | 571 | $customer_ean = $this->processRequestData($customer_ean); |
572 | 572 | if (!$this->webshop->getBasket()->saveCustomerEan($customer_ean)) { |
573 | 573 | require_once 'XML/RPC2/Exception.php'; |
574 | - throw new XML_RPC2_FaultException('ean could not be saved ' . strtolower(implode(', ', $this->webshop->error->getMessage())), -4); |
|
574 | + throw new XML_RPC2_FaultException('ean could not be saved '.strtolower(implode(', ', $this->webshop->error->getMessage())), -4); |
|
575 | 575 | } |
576 | 576 | |
577 | 577 | return $this->prepareResponseData(true); |
@@ -613,7 +613,7 @@ discard block |
||
613 | 613 | $customer_comment = $this->processRequestData($customer_comment); |
614 | 614 | if (!$this->webshop->getBasket()->saveCustomerComment($customer_comment)) { |
615 | 615 | require_once 'XML/RPC2/Exception.php'; |
616 | - throw new XML_RPC2_FaultException('datails could not be saved ' . strtolower(implode(', ', $this->webshop->error->getMessage())), -4); |
|
616 | + throw new XML_RPC2_FaultException('datails could not be saved '.strtolower(implode(', ', $this->webshop->error->getMessage())), -4); |
|
617 | 617 | } |
618 | 618 | |
619 | 619 | return $this->prepareResponseData(true); |
@@ -672,7 +672,7 @@ discard block |
||
672 | 672 | $payment_method = $this->processRequestData($payment_method); |
673 | 673 | if (!$this->webshop->getBasket()->savePaymentMethod($payment_method)) { |
674 | 674 | require_once 'XML/RPC2/Exception.php'; |
675 | - throw new XML_RPC2_FaultException('datails could not be saved ' . strtolower(implode(', ', $this->webshop->error->getMessage())), -4); |
|
675 | + throw new XML_RPC2_FaultException('datails could not be saved '.strtolower(implode(', ', $this->webshop->error->getMessage())), -4); |
|
676 | 676 | } |
677 | 677 | |
678 | 678 | return $this->prepareResponseData(true); |
@@ -48,6 +48,9 @@ discard block |
||
48 | 48 | $this->value['saldo'] = 100; |
49 | 49 | } |
50 | 50 | |
51 | + /** |
|
52 | + * @param string $type |
|
53 | + */ |
|
51 | 54 | function getSaldo($type, $date_from, $date_to) |
52 | 55 | { |
53 | 56 | |
@@ -79,6 +82,9 @@ discard block |
||
79 | 82 | return 1; |
80 | 83 | } |
81 | 84 | |
85 | + /** |
|
86 | + * @param integer $id |
|
87 | + */ |
|
82 | 88 | function getAccount($id) |
83 | 89 | { |
84 | 90 | return new FakeVatPeriodAccount(new FakeVatPeriodYear, $id); |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | |
105 | 105 | // ganges med -1 for at f� rigtigt fortegn til udregning |
106 | 106 | $this->value['saldo_vat_out'] = $account_vat_in->get('saldo'); |
107 | - $saldo_total += -1 * $this->value['saldo_vat_out']; // total |
|
107 | + $saldo_total += -1*$this->value['saldo_vat_out']; // total |
|
108 | 108 | |
109 | 109 | |
110 | 110 | // Moms af varek�b i udlandet |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | |
116 | 116 | // ganges med -1 for at f� rigtigt fortegn til udregning |
117 | 117 | $this->value['saldo_vat_abroad'] = $account_vat_abroad->get('saldo'); |
118 | - $saldo_total += -1 * $this->value['saldo_vat_abroad']; |
|
118 | + $saldo_total += -1*$this->value['saldo_vat_abroad']; |
|
119 | 119 | |
120 | 120 | // K�bsmoms |
121 | 121 | // K�bsmomsen inkluderer ogs� den udregnede moms af moms af varek�b i udlandet. |
@@ -8,6 +8,10 @@ discard block |
||
8 | 8 | public $kernel; |
9 | 9 | public $cmssite; |
10 | 10 | public $dbquery; |
11 | + |
|
12 | + /** |
|
13 | + * @param FakeCMSSite $site |
|
14 | + */ |
|
11 | 15 | function __construct($site) |
12 | 16 | { |
13 | 17 | $this->cmssite = $site; |
@@ -37,6 +41,10 @@ discard block |
||
37 | 41 | { |
38 | 42 | public $kernel; |
39 | 43 | public $cmssite; |
44 | + |
|
45 | + /** |
|
46 | + * @param FakeCMSPage $page |
|
47 | + */ |
|
40 | 48 | function __construct($page) |
41 | 49 | { |
42 | 50 | $this->cmspage = $page; |
@@ -12,7 +12,7 @@ |
||
12 | 12 | { |
13 | 13 | $this->cmssite = $site; |
14 | 14 | $this->kernel = $site->kernel; |
15 | - $this->dbquery = new Intraface_DBQuery($this->kernel, 'cms_page', 'cms_page.intranet_id = '.$this->kernel->intranet->get('id').' AND cms_page.active = 1 AND site_id = ' . $this->cmssite->get('id')); |
|
15 | + $this->dbquery = new Intraface_DBQuery($this->kernel, 'cms_page', 'cms_page.intranet_id = '.$this->kernel->intranet->get('id').' AND cms_page.active = 1 AND site_id = '.$this->cmssite->get('id')); |
|
16 | 16 | } |
17 | 17 | function get() |
18 | 18 | { |
@@ -6,6 +6,9 @@ |
||
6 | 6 | { |
7 | 7 | public $kernel; |
8 | 8 | |
9 | + /** |
|
10 | + * @param Stub_Kernel $kernel |
|
11 | + */ |
|
9 | 12 | function __construct($kernel) |
10 | 13 | { |
11 | 14 | $this->kernel = $kernel; |
@@ -9,6 +9,9 @@ |
||
9 | 9 | public $kernel; |
10 | 10 | public $cmssite; |
11 | 11 | |
12 | + /** |
|
13 | + * @param Stub_Kernel $kernel |
|
14 | + */ |
|
12 | 15 | function __construct($kernel) |
13 | 16 | { |
14 | 17 | $this->kernel = $kernel; |
@@ -52,6 +52,9 @@ |
||
52 | 52 | } |
53 | 53 | } |
54 | 54 | |
55 | + /** |
|
56 | + * @param string $post |
|
57 | + */ |
|
55 | 58 | function createPost($post) |
56 | 59 | { |
57 | 60 | $result = $this->db->exec('INSERT INTO ' . $this->table . ' (name) VALUES ('.$this->db->quote($post, 'text').')'); |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | |
18 | 18 | $result = $this->db->exec('TRUNCATE TABLE dbquery_result'); |
19 | 19 | |
20 | - $result = $this->db->exec('DROP TABLE ' . $this->table); |
|
20 | + $result = $this->db->exec('DROP TABLE '.$this->table); |
|
21 | 21 | /* |
22 | 22 | TODO: DROP THE TABLE IF IT EXISTS |
23 | 23 | |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | } |
29 | 29 | */ |
30 | 30 | |
31 | - $result = $this->db->exec('CREATE TABLE ' . $this->table . '( |
|
31 | + $result = $this->db->exec('CREATE TABLE '.$this->table.'( |
|
32 | 32 | id int(11) NOT NULL auto_increment, name varchar(255) NOT NULL, PRIMARY KEY (id))'); |
33 | 33 | |
34 | 34 | if (PEAR::isError($result)) { |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | |
55 | 55 | function createPost($post) |
56 | 56 | { |
57 | - $result = $this->db->exec('INSERT INTO ' . $this->table . ' (name) VALUES ('.$this->db->quote($post, 'text').')'); |
|
57 | + $result = $this->db->exec('INSERT INTO '.$this->table.' (name) VALUES ('.$this->db->quote($post, 'text').')'); |
|
58 | 58 | if (PEAR::isError($result)) { |
59 | 59 | die($result->getUserInfo()); |
60 | 60 | } |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | |
63 | 63 | function tearDown() |
64 | 64 | { |
65 | - $result = $this->db->exec('DROP TABLE ' . $this->table); |
|
65 | + $result = $this->db->exec('DROP TABLE '.$this->table); |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | /////////////////////////////////////////////////////////////////////////// |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | $this->assertEquals($paging_name, $dbquery->getPagingVarName()); |
106 | 106 | |
107 | 107 | $paging = $dbquery->getPaging(); |
108 | - $expected_offset = array(1=>0, 2=>2, 3=>4, 4=>6, 5=>8, 6=>10, 7=>12, 8=>14, 9=>16,10=>18,11=>20); |
|
108 | + $expected_offset = array(1=>0, 2=>2, 3=>4, 4=>6, 5=>8, 6=>10, 7=>12, 8=>14, 9=>16, 10=>18, 11=>20); |
|
109 | 109 | $this->assertEquals($expected_offset, $paging['offset']); |
110 | 110 | $this->assertEquals(0, $paging['previous']); |
111 | 111 | $this->assertEquals(2, $paging['next']); |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | |
120 | 120 | $db = $dbquery->getRecordset('id, name'); |
121 | 121 | $i = 0; |
122 | - while($db->nextRecord()) { |
|
122 | + while ($db->nextRecord()) { |
|
123 | 123 | $result[$i]['id'] = $db->f('id'); |
124 | 124 | $result[$i]['name'] = $db->f('name'); |
125 | 125 | $i++; |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | $dbquery->storeResult("use_stored", 'unittest', "toplevel"); |
142 | 142 | $db = $dbquery->getRecordset('id, name'); |
143 | 143 | $i = 0; |
144 | - while($db->nextRecord()) { |
|
144 | + while ($db->nextRecord()) { |
|
145 | 145 | $result[$i]['id'] = $db->f('id'); |
146 | 146 | $result[$i]['name'] = $db->f('name'); |
147 | 147 | $i++; |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | $dbquery->storeResult("use_stored", 'unittest', "toplevel"); |
169 | 169 | $db = $dbquery->getRecordset('id, name'); |
170 | 170 | $i = 0; |
171 | - while($db->nextRecord()) { |
|
171 | + while ($db->nextRecord()) { |
|
172 | 172 | $result[$i]['id'] = $db->f('id'); |
173 | 173 | $result[$i]['name'] = $db->f('name'); |
174 | 174 | $i++; |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | $dbquery->storeResult("use_stored", 'unittest', "toplevel"); |
196 | 196 | $db = $dbquery->getRecordset('id, name'); |
197 | 197 | $i = 0; |
198 | - while($db->nextRecord()) { |
|
198 | + while ($db->nextRecord()) { |
|
199 | 199 | $result[$i]['id'] = $db->f('id'); |
200 | 200 | $result[$i]['name'] = $db->f('name'); |
201 | 201 | $i++; |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | $dbquery->storeResult("use_stored", 'unittest', "toplevel"); |
223 | 223 | $db = $dbquery->getRecordset('id, name'); |
224 | 224 | $i = 0; |
225 | - while($db->nextRecord()) { |
|
225 | + while ($db->nextRecord()) { |
|
226 | 226 | $result[$i]['id'] = $db->f('id'); |
227 | 227 | $result[$i]['name'] = $db->f('name'); |
228 | 228 | $i++; |
@@ -4,6 +4,9 @@ |
||
4 | 4 | private $id = 1; |
5 | 5 | public $kernel; |
6 | 6 | |
7 | + /** |
|
8 | + * @param FakeContactKernel $kernel |
|
9 | + */ |
|
7 | 10 | function __construct($kernel) |
8 | 11 | { |
9 | 12 | $this->kernel = $kernel; |
@@ -42,7 +42,7 @@ |
||
42 | 42 | |
43 | 43 | function useShared($shared) |
44 | 44 | { |
45 | - switch($shared) { |
|
45 | + switch ($shared) { |
|
46 | 46 | case 'email': |
47 | 47 | require_once 'Intraface/shared/email/Email.php'; |
48 | 48 | break; |
@@ -63,6 +63,10 @@ discard block |
||
63 | 63 | class FakeDebtorSetting |
64 | 64 | { |
65 | 65 | |
66 | + /** |
|
67 | + * @param string $type |
|
68 | + * @param string $setting |
|
69 | + */ |
|
66 | 70 | function get($type, $setting) |
67 | 71 | { |
68 | 72 | |
@@ -145,6 +149,9 @@ discard block |
||
145 | 149 | |
146 | 150 | } |
147 | 151 | |
152 | + /** |
|
153 | + * @param Invoice $debtor |
|
154 | + */ |
|
148 | 155 | function createPayment($debtor) |
149 | 156 | { |
150 | 157 | $payment = new Payment($debtor); |
@@ -41,7 +41,7 @@ |
||
41 | 41 | } |
42 | 42 | function get($key = '') |
43 | 43 | { |
44 | - $info = array('name' => 'Intranetname', 'contact_person' => '','id' => 1); |
|
44 | + $info = array('name' => 'Intranetname', 'contact_person' => '', 'id' => 1); |
|
45 | 45 | if (empty($key)) { |
46 | 46 | return $info; |
47 | 47 | } else { |