[size=“1”]i don’t have match time and describe how i came to it.(if some one will be interested in that just comment i will answer later).[/size]
[center]ActiveStructure[/center]
Active structure represent structure of DB, that currently used,
-
when DB is empty it possible to fill it with needed structure
-
when DB contained some structure its possible to generate this ActiveSctructure objects
-
and synchronizing structure betwin Db and AS objects.
-
possible to use DB structure changes in realtime, for creating DB-structure programmatically.
some usage example
class Post extends ActiveStructure
{
public $structure = array(
array(‘id’=>‘int’,‘primarykey’),
array(‘post’=>‘text’),
array(‘user’=>‘text’),
)
(overrides) public synchronize(){
return false;//no sincronization
return $this;//sincronize db to this file
return ‘data_base’;//sincronize this to target database;
}
}