Doctrine 1
  1. Doctrine 1
  2. DC-947

getRandom() method for Doctrine_Table

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      Consider adding this method into Doctrine_Table

      public static function getRandom()
      {
      return
      self::getInstance()->createQuery()
      ->select('*, RANDOM() as rand')
      ->limit(1)
      ->orderBy('rand')
      ->fetchOne();
      }

      It is portable and very useful.

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Jonathan H. Wage
            Reporter:
            ddead profile
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: