Skip to content

Commit

Permalink
6.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
aliyilmaz committed Oct 17, 2024
1 parent 00c0a66 commit fe6a51d
Showing 1 changed file with 31 additions and 31 deletions.
62 changes: 31 additions & 31 deletions Mind.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
*
* @package Mind
* @version Release: 5.9.9
* @version Release: 6.0.0
* @license GPL3
* @author Ali YILMAZ <[email protected]>
* @category Php Framework, Design pattern builder for PHP.
Expand Down Expand Up @@ -4721,42 +4721,26 @@ public function getLang(){
/**
* @return array
*/
public function blood_groups(){
$bloods = array(
'AB+'=> array(
'AB+', 'AB-', 'B+', 'B-', 'A+', 'A-', '0+', '0-'
),
'AB-'=> array(
'AB-', 'B-', 'A-', '0-'
),
'B+'=> array(
'B+', 'B2-', '0+', '0-'
),
'B-'=> array(
'B-', '0-'
),
'A+'=> array(
'A+', 'A-', '0+', '0-'
),
'A-'=> array(
'A-', '0-'
),
'0+'=> array(
'0+', '0-'
),
'0-'=> array(
'0-'
)
);

return $bloods;
public function blood_groups() {
$blood_groups = [
'AB+' => ['AB+', 'AB-', 'B+', 'B-', 'A+', 'A-', '0+', '0-'],
'AB-' => ['AB-', 'B-', 'A-', '0-'],
'B+' => ['B+', 'B-', '0+', '0-'],
'B-' => ['B-', '0-'],
'A+' => ['A+', 'A-', '0+', '0-'],
'A-' => ['A-', '0-'],
'0+' => ['0+', '0-'],
'0-' => ['0-']
];

return $blood_groups;
}

/**
* @param string $blood
* @return array
*/
public function getDonor($blood){
public function getDonors($blood){
$bloods = $this->blood_groups();

if(!in_array($blood, array_keys($bloods))){
Expand All @@ -4766,6 +4750,22 @@ public function getDonor($blood){
return $bloods[mb_strtoupper($blood)];
}

/**
* @param string $blood
* @return array
*/
public function getRecipients($blood){
$bloods = $this->blood_groups();

$towhom = [];
foreach ($bloods as $group => $donors) {
if (in_array($blood, $donors)) {
$towhom[] = $group;
}
}
return $towhom;
}

/**
* getAddressCode
*
Expand Down

0 comments on commit fe6a51d

Please sign in to comment.