Autodoc
  • Namespace
  • Class
  • Tree

Namespaces

  • BlueTihi
    • Context
  • Brickrouge
    • Element
      • Nodes
    • Renderer
    • Widget
  • ICanBoogie
    • ActiveRecord
    • AutoConfig
    • CLDR
    • Composer
    • Core
    • Event
    • Exception
    • HTTP
      • Dispatcher
      • Request
    • I18n
      • Translator
    • Mailer
    • Modules
      • Taxonomy
        • Support
      • Thumbnailer
        • Versions
    • Object
    • Operation
      • Dispatcher
    • Prototype
    • Routes
    • Routing
      • Dispatcher
    • Session
  • Icybee
    • ActiveRecord
      • Model
    • ConfigOperation
    • Document
    • EditBlock
    • Element
      • ActionbarContextual
      • ActionbarSearch
      • ActionbarToolbar
    • FormBlock
    • Installer
    • ManageBlock
    • Modules
      • Articles
      • Cache
        • Collection
        • ManageBlock
      • Comments
        • ManageBlock
      • Contents
        • ManageBlock
      • Dashboard
      • Editor
        • Collection
      • Files
        • File
        • ManageBlock
      • Forms
        • Form
        • ManageBlock
      • I18n
      • Images
        • ManageBlock
      • Members
      • Modules
        • ManageBlock
      • Nodes
        • ManageBlock
        • Module
      • Pages
        • BreadcrumbElement
        • LanguagesElement
        • ManageBlock
        • NavigationBranchElement
        • NavigationElement
        • Page
        • PageController
      • Registry
      • Search
      • Seo
      • Sites
        • ManageBlock
      • Taxonomy
        • Terms
          • ManageBlock
        • Vocabulary
          • ManageBlock
      • Users
        • ManageBlock
        • NonceLogin
        • Roles
      • Views
        • ActiveRecordProvider
        • Collection
        • View
    • Operation
      • ActiveRecord
      • Constructor
      • Module
      • Widget
    • Rendering
  • None
  • Patron
  • PHP

Classes

  • DeleteOperation
  • EditBlock
  • Hooks
  • ManageBlock
  • Member
  • Model
  • Module
  • SaveOperation
 1 <?php
 2 
 3 /*
 4  * This file is part of the Icybee package.
 5  *
 6  * (c) Olivier Laviale <olivier.laviale@gmail.com>
 7  *
 8  * For the full copyright and license information, please view the LICENSE
 9  * file that was distributed with this source code.
10  */
11 
12 namespace Icybee\Modules\Members;
13 
14 class Model extends \Icybee\Modules\Users\Model
15 {
16     public function save(array $properties, $key=null, array $options=array())
17     {
18         global $core;
19 
20         $photo = null;
21         $photo_path = null;
22 
23         if (isset($properties['photo']) && is_object($properties['photo']))
24         {
25             $photo = $properties['photo'];
26 
27 //          \ICanBoogie\log('photo: \1', array($photo));
28 
29             $filename = \ICanBoogie\normalize($properties['username']) . $photo->extension;
30             $photo_path = $core->config['repository'] . '/files/members/' . $filename;
31             $properties['photo'] = $photo_path;
32         }
33 
34         $rc = parent::save($properties, $key, $options);
35 
36 //      \ICanBoogie\log('photo: \1, properties: \2', array($photo, $properties));
37 
38         if ($rc && $photo)
39         {
40             $photo->move($_SERVER['DOCUMENT_ROOT'] . $photo_path, true);
41         }
42 
43         return $rc;
44     }
45 }
Autodoc API documentation generated by ApiGen 2.8.0