Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [Kohana] Dziedziczenie _has_many, kohana 3.2
Kedan
post
Post #1





Grupa: Zarejestrowani
Postów: 53
Pomógł: 1
Dołączył: 20.07.2007

Ostrzeżenie: (0%)
-----


Witam.

Chcę zrobić coś takiego by klasa potomna nie tyle dziedziczyła tablicę _has_many ile ją "rozszerzała":
  1. class ORM extends Kohana_ORM {
  2.  
  3. protected $_extends_has_many = TRUE;
  4.  
  5. public function __construct($id = NULL) {
  6. parent::__construct($id);
  7. $this->_extends_has_many();
  8. }
  9.  
  10. protected function _extends_has_many() {
  11. if($this->_extends_has_many && !empty($this->_has_many)) {
  12. $this->_has_many = array_merge(parent::has_many(),$this->_has_many);
  13. }
  14. }
  15.  
  16. }

Niestety nie działa. Ma ktoś jakieś koncepcje?
Go to the top of the page
+Quote Post

Posty w temacie
- Kedan   [Kohana] Dziedziczenie _has_many   31.08.2011, 08:49:56


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 19.08.2025 - 11:34