| @@ 776-792 (lines=17) @@ | ||
| 773 | * |
|
| 774 | * @return null|Source |
|
| 775 | */ |
|
| 776 | public function fetchSourceByName($sourceName) |
|
| 777 | { |
|
| 778 | $source = null; |
|
| 779 | $query = $this->dbConn->createQueryBuilder() |
|
| 780 | ->select('*') |
|
| 781 | ->from('sources') |
|
| 782 | ->where('name = :name') |
|
| 783 | ->setParameter(':name', $sourceName); |
|
| 784 | ||
| 785 | $row = $query->execute()->fetch(PDO::FETCH_ASSOC); |
|
| 786 | ||
| 787 | if ($row) { |
|
| 788 | $source = $this->buildSourceFromDbRow($row); |
|
| 789 | } |
|
| 790 | ||
| 791 | return $source; |
|
| 792 | } |
|
| 793 | ||
| 794 | ||
| 795 | /** |
|
| @@ 799-815 (lines=17) @@ | ||
| 796 | * @param $sourceId |
|
| 797 | * @return null|Source |
|
| 798 | */ |
|
| 799 | public function fetchSourceById($sourceId) |
|
| 800 | { |
|
| 801 | $source = null; |
|
| 802 | $query = $this->dbConn->createQueryBuilder() |
|
| 803 | ->select('*') |
|
| 804 | ->from('sources') |
|
| 805 | ->where('id = :id') |
|
| 806 | ->setParameter(':id', $sourceId); |
|
| 807 | ||
| 808 | $row = $query->execute()->fetch(PDO::FETCH_ASSOC); |
|
| 809 | ||
| 810 | if ($row) { |
|
| 811 | $source = $this->buildSourceFromDbRow($row); |
|
| 812 | } |
|
| 813 | ||
| 814 | return $source; |
|
| 815 | } |
|
| 816 | ||
| 817 | public function fetchPlatformByName($platformName) |
|
| 818 | { |
|
| @@ 817-833 (lines=17) @@ | ||
| 814 | return $source; |
|
| 815 | } |
|
| 816 | ||
| 817 | public function fetchPlatformByName($platformName) |
|
| 818 | { |
|
| 819 | $platform = null; |
|
| 820 | $query = $this->dbConn->createQueryBuilder() |
|
| 821 | ->select('*') |
|
| 822 | ->from('platforms') |
|
| 823 | ->where('name = :name') |
|
| 824 | ->setParameter(':name', $platformName); |
|
| 825 | ||
| 826 | $row = $query->execute()->fetch(PDO::FETCH_ASSOC); |
|
| 827 | ||
| 828 | if ($row) { |
|
| 829 | $platform = $this->buildPlatformFromDbRow($row); |
|
| 830 | } |
|
| 831 | ||
| 832 | return $platform; |
|
| 833 | } |
|
| 834 | ||
| 835 | /** |
|
| 836 | * Fetch all available platforms |
|
| @@ 874-890 (lines=17) @@ | ||
| 871 | * @param $name |
|
| 872 | * @return null|Instrument |
|
| 873 | */ |
|
| 874 | public function fetchInstrumentByName($name) |
|
| 875 | { |
|
| 876 | $instrument = null; |
|
| 877 | $query = $this->dbConn->createQueryBuilder() |
|
| 878 | ->select('*') |
|
| 879 | ->from('instruments') |
|
| 880 | ->where('name = :name') |
|
| 881 | ->setParameter(':name', $name); |
|
| 882 | ||
| 883 | $row = $query->execute()->fetch(PDO::FETCH_ASSOC); |
|
| 884 | ||
| 885 | if ($row) { |
|
| 886 | $instrument = $this->buildInstrumentFromDbRow($row); |
|
| 887 | } |
|
| 888 | ||
| 889 | return $instrument; |
|
| 890 | } |
|
| 891 | ||
| 892 | protected function fetchInstrumentByAbbreviation($abbreviation) |
|
| 893 | { |
|
| @@ 892-908 (lines=17) @@ | ||
| 889 | return $instrument; |
|
| 890 | } |
|
| 891 | ||
| 892 | protected function fetchInstrumentByAbbreviation($abbreviation) |
|
| 893 | { |
|
| 894 | $instrument = null; |
|
| 895 | $query = $this->dbConn->createQueryBuilder() |
|
| 896 | ->select('*') |
|
| 897 | ->from('instruments') |
|
| 898 | ->where('abbreviation = :abbreviation') |
|
| 899 | ->setParameter(':abbreviation', $abbreviation); |
|
| 900 | ||
| 901 | $row = $query->execute()->fetch(PDO::FETCH_ASSOC); |
|
| 902 | ||
| 903 | if ($row) { |
|
| 904 | $instrument = $this->buildInstrumentFromDbRow($row); |
|
| 905 | } |
|
| 906 | ||
| 907 | return $instrument; |
|
| 908 | } |
|
| 909 | ||
| 910 | ||
| 911 | /** |
|