]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/QnA/classes/QnA_Question.php
Added type-hint for entryForm() method + renamed $action back to $out from
[quix0rs-gnu-social.git] / plugins / QnA / classes / QnA_Question.php
index 66eb1b12362b7b826f307212bb20f5fded21946d..079f09fb6bf46143383d64a343a1f37ba93ba8e6 100644 (file)
@@ -48,7 +48,7 @@ class QnA_Question extends Managed_DataObject
 
     public $__table = 'qna_question'; // table name
     public $id;          // char(36) primary key not null -> UUID
-    public $uri;
+    public $uri;         // varchar(191)   not 255 because utf8mb4 takes more space
     public $profile_id;  // int -> profile.id
     public $title;       // text
     public $description; // text
@@ -71,7 +71,7 @@ class QnA_Question extends Managed_DataObject
                 ),
                 'uri' => array(
                     'type'     => 'varchar',
-                    'length'   => 255,
+                    'length'   => 191,
                     'not null' => true
                 ),
                 'profile_id'  => array('type' => 'int'),
@@ -97,7 +97,7 @@ class QnA_Question extends Managed_DataObject
      *
      * @return Question found question or null
      */
-    static function getByNotice($notice)
+    static function getByNotice(Notice $notice)
     {
         return self::getKV('uri', $notice->uri);
     }
@@ -164,7 +164,7 @@ class QnA_Question extends Managed_DataObject
         return $a->count();
     }
 
-    static function fromNotice($notice)
+    static function fromNotice(Notice $notice)
     {
         return QnA_Question::getKV('uri', $notice->uri);
     }
@@ -179,7 +179,7 @@ class QnA_Question extends Managed_DataObject
         return self::toString($this->getProfile(), $this);
     }
 
-    static function toHTML($profile, $question)
+    static function toHTML(Profile $profile, $question)
     {
         $notice = $question->getNotice();
 
@@ -237,7 +237,7 @@ class QnA_Question extends Managed_DataObject
      *
      * @return Notice saved notice
      */
-    static function saveNew($profile, $title, $description, $options = array())
+    static function saveNew(Profile $profile, $title, $description, array $options = array())
     {
         $q = new QnA_Question();