MongodbDeleteClassLog.php 720 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. class MongodbDeleteClassLog extends EMongoDocument {
  3. public $school_id;
  4. public $coach_id;
  5. public $table_name;
  6. public $content;
  7. public $create_time;
  8. public static function model($className = __CLASS__){
  9. return parent::model($className);
  10. }
  11. public function collectionName()
  12. {
  13. return 'exam_class_delete_log';
  14. }
  15. public static function add($collection,$school_id,$coach_id,$model)
  16. {
  17. $collection->insert(array(
  18. 'school_id' => $school_id,
  19. 'coach_id' => $coach_id,
  20. 'table_name' => $model->tableName(),
  21. 'content' => json_encode($model->attributes,true),
  22. 'create_time' => time()));
  23. }
  24. }