Q:

How to chain four conditions in a shorthand if-else-statement

I am displaying a Google map on my website which loops through a number of values based on their co-ordinates in the database. 
There are four different types of partners and these are highlighted with different coloured marker pins. 
So far I am successfully showing 3 different coloured markers using a shorthand if-else statement.  How can I add one more condition in to this to show my final coloured marker for Type4? 
<? php
$markers = array();
foreach ($current as $key => $value) {

$markers[] = array(
  'latLng' => array($value['Partner']['lat'], $value['Partner']['lon']),
  'options' => array(
    'icon' => $this->Html->url('/img/icons/'.($value['Partner']['type1'] ? ' pink-pin.png' : ($value['Partner']['type2'] ? ' green-pin.png' : 'purple-pin.png'))),
  ),
  'data' => array(
    'html' => 
      '<p>'.$value['Partner']['name'].'</p>'
  ),
);
}
? >

A:

I would not recommend using the shorthand condition in this case, as it will become quite complicated and unworkable. 
Instead, use a chain of if-else statements:
<? php
$markers = array();
foreach ($current as $key => $value) {
    if($value['Partner']['type1']) {
        $icon = 'pink-pin.png';
    } elseif($value['Partner']['type2']) {
        $icon = 'green-pin.png';
    }  elseif($value['Partner']['type3']) {
        $icon = 'black-pin.png';
    } else {
        $icon = 'blue-pin.png';
    }

    $markers[] = array(
        'latLng' => array($value['Partner']['lat'], $value['Partner']['lon']),
        'options' => array(
            'icon' => $icon,
        ),
        'data' => array(
            'html' => '<p>' .  $value['Partner']['name'] . ' </p>'
        ),
    );
}
? >

You can add or remove as many types as you want to.