| @@ 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 | * @param $songId |
|
| @@ 852-868 (lines=17) @@ | ||
| 849 | * @param $name |
|
| 850 | * @return null|Instrument |
|
| 851 | */ |
|
| 852 | public function fetchInstrumentByName($name) |
|
| 853 | { |
|
| 854 | $instrument = null; |
|
| 855 | $query = $this->dbConn->createQueryBuilder() |
|
| 856 | ->select('*') |
|
| 857 | ->from('instruments') |
|
| 858 | ->where('name = :name') |
|
| 859 | ->setParameter(':name', $name); |
|
| 860 | ||
| 861 | $row = $query->execute()->fetch(PDO::FETCH_ASSOC); |
|
| 862 | ||
| 863 | if ($row) { |
|
| 864 | $instrument = $this->buildInstrumentFromDbRow($row); |
|
| 865 | } |
|
| 866 | ||
| 867 | return $instrument; |
|
| 868 | } |
|
| 869 | ||
| 870 | protected function fetchInstrumentByAbbreviation($abbreviation) |
|
| 871 | { |
|
| @@ 870-886 (lines=17) @@ | ||
| 867 | return $instrument; |
|
| 868 | } |
|
| 869 | ||
| 870 | protected function fetchInstrumentByAbbreviation($abbreviation) |
|
| 871 | { |
|
| 872 | $instrument = null; |
|
| 873 | $query = $this->dbConn->createQueryBuilder() |
|
| 874 | ->select('*') |
|
| 875 | ->from('instruments') |
|
| 876 | ->where('abbreviation = :abbreviation') |
|
| 877 | ->setParameter(':abbreviation', $abbreviation); |
|
| 878 | ||
| 879 | $row = $query->execute()->fetch(PDO::FETCH_ASSOC); |
|
| 880 | ||
| 881 | if ($row) { |
|
| 882 | $instrument = $this->buildInstrumentFromDbRow($row); |
|
| 883 | } |
|
| 884 | ||
| 885 | return $instrument; |
|
| 886 | } |
|
| 887 | ||
| 888 | ||
| 889 | /** |
|