MongoImage.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <?php
  2. /**
  3. * EMongoGridFS.php
  4. *
  5. * PHP version 5.2+
  6. *
  7. * @author Jose Martinez <jmartinez@ibitux.com>
  8. * @author Philippe Gaultier <pgaultier@ibitux.com>
  9. * @copyright 2010 Ibitux
  10. * @license http://www.yiiframework.com/license/ BSD license
  11. * @version SVN: $Revision: $
  12. * @category ext
  13. * @package ext.YiiMongoDbSuite
  14. */
  15. /**
  16. * EMongoGridFS
  17. *
  18. * Authorization management, dispatches actions and views on the system
  19. *
  20. * @author Jose Martinez <jmartinez@ibitux.com>
  21. * @author Philippe Gaultier <pgaultier@ibitux.com>
  22. * @copyright 2010 Ibitux
  23. * @license http://www.yiiframework.com/license/ BSD license
  24. * @version SVN: $Revision: $
  25. * @category ext
  26. * @package ext.YiiMongoDbSuite
  27. *
  28. */
  29. class MongoImage extends EMongoGridFS
  30. {
  31. public $metadata;
  32. /**
  33. * this is similar to the get tableName() method. this returns tha name of the
  34. * document for this class. this should be in all lowercase.
  35. */
  36. public function getCollectionName()
  37. {
  38. return 'images';
  39. }
  40. /**
  41. * Returns the static model of the specified AR class.
  42. *
  43. * @param string $className class name
  44. *
  45. * @return CompaniesDb the static model class
  46. */
  47. public static function model($className=__CLASS__)
  48. {
  49. return parent::model($className);
  50. }
  51. public function rules()
  52. {
  53. return array(
  54. array('filename, metadata','safe'),
  55. array('filename','required'),
  56. );
  57. }
  58. }