속성 내가이 MySQL의 테이블 (간략화 됨)이 있습니다Kohana3 ORM은 :로드 키/값
articles
- id
- description
article_attributes
- article_id
- attribute_name
- attribute_value
그래서, 모든 article
는 attributes
의 무제한을 가질 수 있습니다. 는 articles
를 들어 내가 가지고 Kohana_ORM 모델
<?php class Model_Article extends ORM {} ?>
내가 모든 속성에 대한 액세스 권한을하고 싶은 모델을로드.
예 :
<?php
$article = new Model_Article(1); // or ORM::factory('article', 1);
echo $article->description;
echo $article->attribute->foo;
echo $article->attribute->bar;
?>
사람이 올바른 방향으로 날 지점 시겠어요하는 방법이 실현하려?