Closed iomariani closed 8 years ago
This will affect only when you have more primary keys than the default (id, temporal_start, temporal_end);
class Model_Example extends \Orm\Model_Temporal { protected static $_primary_key = array('id', 'fk_id', 'fk2_id', 'temporal_start', 'temporal_end'); }
It will use the function getNonTimestampPks() and add it to the where conditions before sending the query to execute.
Be noted when you use the find, find_revision, find_revisions_between, you must inform all PKs (except temporal ones)
Model_Temporal::find(array($id, $fk_id, $fk2_id)); Model_Temporal::find_revision(array($id, $fk_id, $fk2_id), $temporal_start); Model_Temporal::find_revisions_between(array($id, $fk_id, $fk2_id), $temporal_start, $temporal_end);
This edit also removed the $relations argument from find_revision. Instead, you should provide the $options, as in any Model\Query instance;
array( 'related' => array('related1', 'related2', 'relatedN'), 'where' => array(), )
This will affect only when you have more primary keys than the default (id, temporal_start, temporal_end);
It will use the function getNonTimestampPks() and add it to the where conditions before sending the query to execute.
Be noted when you use the find, find_revision, find_revisions_between, you must inform all PKs (except temporal ones)
This edit also removed the $relations argument from find_revision. Instead, you should provide the $options, as in any Model\Query instance;