| @@ 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 |
|
| @@ 896-912 (lines=17) @@ | ||
| 893 | * @param $name |
|
| 894 | * @return null|Instrument |
|
| 895 | */ |
|
| 896 | public function fetchInstrumentByName($name) |
|
| 897 | { |
|
| 898 | $instrument = null; |
|
| 899 | $query = $this->dbConn->createQueryBuilder() |
|
| 900 | ->select('*') |
|
| 901 | ->from('instruments') |
|
| 902 | ->where('name = :name') |
|
| 903 | ->setParameter(':name', $name); |
|
| 904 | ||
| 905 | $row = $query->execute()->fetch(PDO::FETCH_ASSOC); |
|
| 906 | ||
| 907 | if ($row) { |
|
| 908 | $instrument = $this->buildInstrumentFromDbRow($row); |
|
| 909 | } |
|
| 910 | ||
| 911 | return $instrument; |
|
| 912 | } |
|
| 913 | ||
| 914 | protected function fetchInstrumentByAbbreviation($abbreviation) |
|
| 915 | { |
|
| @@ 914-930 (lines=17) @@ | ||
| 911 | return $instrument; |
|
| 912 | } |
|
| 913 | ||
| 914 | protected function fetchInstrumentByAbbreviation($abbreviation) |
|
| 915 | { |
|
| 916 | $instrument = null; |
|
| 917 | $query = $this->dbConn->createQueryBuilder() |
|
| 918 | ->select('*') |
|
| 919 | ->from('instruments') |
|
| 920 | ->where('abbreviation = :abbreviation') |
|
| 921 | ->setParameter(':abbreviation', $abbreviation); |
|
| 922 | ||
| 923 | $row = $query->execute()->fetch(PDO::FETCH_ASSOC); |
|
| 924 | ||
| 925 | if ($row) { |
|
| 926 | $instrument = $this->buildInstrumentFromDbRow($row); |
|
| 927 | } |
|
| 928 | ||
| 929 | return $instrument; |
|
| 930 | } |
|
| 931 | ||
| 932 | ||
| 933 | /** |
|