Hawk - PHP documentation
  • Namespace
  • Class
  • Tree

Namespaces

  • Hawk
    • View
      • Plugins

Classes

  • Hawk\App
  • Hawk\ButtonInput
  • Hawk\Cache
  • Hawk\CheckboxInput
  • Hawk\ColorInput
  • Hawk\Conf
  • Hawk\Controller
  • Hawk\Crypto
  • Hawk\DatabaseSessionHandler
  • Hawk\DatetimeInput
  • Hawk\DB
  • Hawk\DBExample
  • Hawk\DeleteInput
  • Hawk\Dialogbox
  • Hawk\EmailInput
  • Hawk\ErrorHandler
  • Hawk\Event
  • Hawk\FileInput
  • Hawk\FileSystem
  • Hawk\FloatInput
  • Hawk\Form
  • Hawk\FormFieldset
  • Hawk\FormInput
  • Hawk\GenericModel
  • Hawk\GifImage
  • Hawk\HawkApi
  • Hawk\HawkUpdater
  • Hawk\HiddenInput
  • Hawk\HtmlInput
  • Hawk\HTTPRequest
  • Hawk\Icon
  • Hawk\Image
  • Hawk\IntegerInput
  • Hawk\ItemList
  • Hawk\ItemListField
  • Hawk\JpegImage
  • Hawk\Lang
  • Hawk\Language
  • Hawk\LeftSidebarTab
  • Hawk\Less
  • Hawk\Logger
  • Hawk\Mail
  • Hawk\MenuItem
  • Hawk\Model
  • Hawk\NoSidebarTab
  • Hawk\NumberInput
  • Hawk\ObjectInput
  • Hawk\Option
  • Hawk\Panel
  • Hawk\PasswordInput
  • Hawk\Permission
  • Hawk\Plugin
  • Hawk\PluginInstaller
  • Hawk\PngImage
  • Hawk\ProfileQuestion
  • Hawk\ProfileQuestionValue
  • Hawk\RadioInput
  • Hawk\Request
  • Hawk\Response
  • Hawk\RightSidebarTab
  • Hawk\Role
  • Hawk\RolePermission
  • Hawk\Route
  • Hawk\Router
  • Hawk\SelectInput
  • Hawk\Session
  • Hawk\Singleton
  • Hawk\SubmitInput
  • Hawk\Tabs
  • Hawk\TextareaInput
  • Hawk\TextInput
  • Hawk\Theme
  • Hawk\TimeInput
  • Hawk\Upload
  • Hawk\User
  • Hawk\View
  • Hawk\View\Plugins\Accordion
  • Hawk\View\Plugins\Button
  • Hawk\View\Plugins\Form
  • Hawk\View\Plugins\Icon
  • Hawk\View\Plugins\Import
  • Hawk\View\Plugins\Panel
  • Hawk\View\Plugins\Tabs
  • Hawk\View\Plugins\Text
  • Hawk\View\Plugins\Uri
  • Hawk\View\Plugins\Widget
  • Hawk\ViewPlugin
  • Hawk\Widget
  • Hawk\WysiwygInput

Traits

  • Hawk\Utils

Exceptions

  • Hawk\AppStopException
  • Hawk\DBExampleException
  • Hawk\DBException
  • Hawk\FileSystemException
  • Hawk\HawkApiException
  • Hawk\ImageException
  • Hawk\MailException
  • Hawk\UploadException
  • Hawk\ViewException
 1 <?php
 2 /**
 3  * ProfileQuestion.php
 4  *
 5  * @author  Elvyrra SAS
 6  * @license http://rem.mit-license.org/ MIT
 7  */
 8 namespace Hawk;
 9 
10 
11 /**
12  * This model describes the customized profile data types
13  *
14  * @package BaseModels
15  */
16 class ProfileQuestion extends Model{
17     /**
18      * The associated table
19      *
20      * @var string
21      */
22     protected static $tablename = "ProfileQuestion";
23 
24     /**
25      * The primary column in the table
26      *
27      * @var string
28      */
29     protected static $primaryColumn = 'name';
30 
31     /**
32      * The allowed input types for customization of profile questions
33      *
34      * @var array
35      */
36     public static $allowedTypes = array(
37         'text',
38         'textarea',
39         'checkbox',
40         'radio',
41         'select',
42         'datetime',
43         'file'
44     );
45 
46     /**
47      * Get a question by it name
48      *
49      * @param string $name The name to search
50      *
51      * @return ProfileQuestion
52      */
53     public static function getByName($name){
54         return self::getById($name);
55     }
56 
57     /**
58      * Get the profile questions that are displayed in the register form
59      *
60      * @return array
61      */
62     public static function getRegisterQuestions(){
63         $example = array(
64         'displayInRegister' => 1
65         );
66         return self::getListByExample(new DBExample($example), self::$primaryColumn, array(), array('order' => DB::SORT_ASC));
67     }
68 
69     /**
70      * Get the profile questions that are displayed publically on the users' profile
71      *
72      * @return array
73      */
74     public static function getDisplayProfileQuestions(){
75         $example = array(
76         'displayInProfile' => 1
77         );
78         return self::getListByExample(new DBExample($example), self::$primaryColumn, array(), array('order' => DB::SORT_ASC));
79     }
80 
81 
82 }
Hawk - PHP documentation API documentation generated by ApiGen