| @@ 806-822 (lines=17) @@ | ||
| 803 | * |
|
| 804 | * @return null|Source |
|
| 805 | */ |
|
| 806 | public function fetchSourceByName($sourceName) |
|
| 807 | { |
|
| 808 | $source = null; |
|
| 809 | $query = $this->dbConn->createQueryBuilder() |
|
| 810 | ->select('*') |
|
| 811 | ->from('sources') |
|
| 812 | ->where('name = :name') |
|
| 813 | ->setParameter(':name', $sourceName); |
|
| 814 | ||
| 815 | $row = $query->execute()->fetch(PDO::FETCH_ASSOC); |
|
| 816 | ||
| 817 | if ($row) { |
|
| 818 | $source = $this->buildSourceFromDbRow($row); |
|
| 819 | } |
|
| 820 | ||
| 821 | return $source; |
|
| 822 | } |
|
| 823 | ||
| 824 | ||
| 825 | /** |
|
| @@ 829-845 (lines=17) @@ | ||
| 826 | * @param $sourceId |
|
| 827 | * @return null|Source |
|
| 828 | */ |
|
| 829 | public function fetchSourceById($sourceId) |
|
| 830 | { |
|
| 831 | $source = null; |
|
| 832 | $query = $this->dbConn->createQueryBuilder() |
|
| 833 | ->select('*') |
|
| 834 | ->from('sources') |
|
| 835 | ->where('id = :id') |
|
| 836 | ->setParameter(':id', $sourceId); |
|
| 837 | ||
| 838 | $row = $query->execute()->fetch(PDO::FETCH_ASSOC); |
|
| 839 | ||
| 840 | if ($row) { |
|
| 841 | $source = $this->buildSourceFromDbRow($row); |
|
| 842 | } |
|
| 843 | ||
| 844 | return $source; |
|
| 845 | } |
|
| 846 | ||
| 847 | public function fetchPlatformByName($platformName) |
|
| 848 | { |
|
| @@ 847-863 (lines=17) @@ | ||
| 844 | return $source; |
|
| 845 | } |
|
| 846 | ||
| 847 | public function fetchPlatformByName($platformName) |
|
| 848 | { |
|
| 849 | $platform = null; |
|
| 850 | $query = $this->dbConn->createQueryBuilder() |
|
| 851 | ->select('*') |
|
| 852 | ->from('platforms') |
|
| 853 | ->where('name = :name') |
|
| 854 | ->setParameter(':name', $platformName); |
|
| 855 | ||
| 856 | $row = $query->execute()->fetch(PDO::FETCH_ASSOC); |
|
| 857 | ||
| 858 | if ($row) { |
|
| 859 | $platform = $this->buildPlatformFromDbRow($row); |
|
| 860 | } |
|
| 861 | ||
| 862 | return $platform; |
|
| 863 | } |
|
| 864 | ||
| 865 | /** |
|
| 866 | * Fetch all available platforms |
|
| @@ 926-942 (lines=17) @@ | ||
| 923 | * @param $name |
|
| 924 | * @return null|Instrument |
|
| 925 | */ |
|
| 926 | public function fetchInstrumentByName($name) |
|
| 927 | { |
|
| 928 | $instrument = null; |
|
| 929 | $query = $this->dbConn->createQueryBuilder() |
|
| 930 | ->select('*') |
|
| 931 | ->from('instruments') |
|
| 932 | ->where('name = :name') |
|
| 933 | ->setParameter(':name', $name); |
|
| 934 | ||
| 935 | $row = $query->execute()->fetch(PDO::FETCH_ASSOC); |
|
| 936 | ||
| 937 | if ($row) { |
|
| 938 | $instrument = $this->buildInstrumentFromDbRow($row); |
|
| 939 | } |
|
| 940 | ||
| 941 | return $instrument; |
|
| 942 | } |
|
| 943 | ||
| 944 | protected function fetchInstrumentByAbbreviation($abbreviation) |
|
| 945 | { |
|
| @@ 944-960 (lines=17) @@ | ||
| 941 | return $instrument; |
|
| 942 | } |
|
| 943 | ||
| 944 | protected function fetchInstrumentByAbbreviation($abbreviation) |
|
| 945 | { |
|
| 946 | $instrument = null; |
|
| 947 | $query = $this->dbConn->createQueryBuilder() |
|
| 948 | ->select('*') |
|
| 949 | ->from('instruments') |
|
| 950 | ->where('abbreviation = :abbreviation') |
|
| 951 | ->setParameter(':abbreviation', $abbreviation); |
|
| 952 | ||
| 953 | $row = $query->execute()->fetch(PDO::FETCH_ASSOC); |
|
| 954 | ||
| 955 | if ($row) { |
|
| 956 | $instrument = $this->buildInstrumentFromDbRow($row); |
|
| 957 | } |
|
| 958 | ||
| 959 | return $instrument; |
|
| 960 | } |
|
| 961 | ||
| 962 | ||
| 963 | /** |
|