felipeabranches / speciesDatabase-alpha-deprecated

A Database to store all kinds of species (alpha deprecated)
2 stars 0 forks source link

Start OOP on species #11

Open peixespnsc opened 5 years ago

peixespnsc commented 5 years ago

Several pages have the need to show the specie's Nomenclature and the Authoring of his first description. We need create a Class to deal with this on libraries/species/species.php. Use the mudules/taxa_tree.php file as reference, and then apply the OOP to it.

Please, commnent bellow the files' names that we can apply this OOP.

TNDMedeiros commented 5 years ago

I started the OOP , in order to show the species' Nomenclature and the Authoring of the first description. Feel free to edit the file, upgrade the Class and work on the function!

peixespnsc commented 5 years ago

@TNMedeiros thanks! But I've some coments

Following our conventions, the Class should be called Species (let's define that the first letter will be capitalized). The conventions are important in order that when I'm programing a new file, I'd not need to open the Class file to know the class name. The more obvious we be, better. Also, you are not getting a Description (a Description are morphologicals datas), you are getting the Nomenclature and the Authors.

Another thing, it will be better we have a function to the Specie's Nomenclature and another to the Specie's Taxonomists. Both taking the Specie's ID. This is important in order to your SQL know when we ask for a specific Specie, and to know to wich Species is some Authors. For the Nomenclature function, we need do some treatement to show the abbreviations when a Specie is dubios (aff., cf. and sp.). For the Authors, we have to show the Taxonomists (with a treatement in cases were we have more then one Author, use the "&" before the last one), the year and put parenteses when the Nomenclature are revised.

Be aware! When making a SQL command, always put the table Alias before the field, what missed in the file's lines: 22 - AND validate = 1 25 - ORDER BY id

And let's start to comment the code!

For some help, see the new class I've uploaded in libraries/museum/tombs.php

TNDMedeiros commented 5 years ago

@peixespnsc, I made a Class named Species, which has 2 functions. One named getNomenclature and another one named getTaxonomists. Both functions are taking the Species' ID, in order to know when we ask for a specific Species, and to know their respective Authors. Feel free to work on the function and make suggestions, so we can enhance it! Thanks.