示例#1
0
 /**
  * Returns information from the database based on the table. Can return a singular row.
  *
  * @param $array
  *
  * @param null $row
  *
  * @return null
  */
 public function Where($array, $row = null)
 {
     $result = Capsule::table($this->active_table)->where($array)->get();
     /**
      * If we are not empty
      */
     if (empty($result) == false) {
         if ($row != null) {
             if (is_int($row) == false) {
                 return null;
             }
             return CherryPick::PickRow($result, $row);
         }
         return CherryPick::QueryToArray($result);
     }
     /**
      * Return null if so.
      */
     return null;
 }
示例#2
0
 /**
  * Gets the publisher of this track
  *
  * @param $id
  *
  * @return null
  */
 public function GetPublisher($id)
 {
     $result = $this->database->Where(["id" => $id]);
     if (empty($result) == true) {
         return null;
     }
     return CherryPick::GetColumn($result, 0, 'publisher');
 }
示例#3
0
 /**
  * Gets the publisher of this album.
  *
  * @param $publisher
  *
  * @return null
  */
 public function GetPublisher($publisher)
 {
     $result = $this->database->Where(["publisher" => $publisher]);
     if (empty($result) == true) {
         return null;
     }
     return CherryPick::QueryToArray($result);
 }