Changeset View
Changeset View
Standalone View
Standalone View
src/infrastructure/storage/lisk/LiskDAO.php
Show First 20 Lines • Show All 1,891 Lines • ▼ Show 20 Lines | foreach ($this->getAllLiskProperties() as $property) { | ||||
} | } | ||||
} | } | ||||
if (isset($binary_map[$property])) { | if (isset($binary_map[$property])) { | ||||
$map[$property] = 'bytes'; | $map[$property] = 'bytes'; | ||||
continue; | continue; | ||||
} | } | ||||
if ($property === 'spacePHID') { | |||||
$map[$property] = 'phid?'; | |||||
continue; | |||||
} | |||||
// If the column is named `somethingPHID`, infer it is a PHID. | // If the column is named `somethingPHID`, infer it is a PHID. | ||||
if (preg_match('/[a-z]PHID$/', $property)) { | if (preg_match('/[a-z]PHID$/', $property)) { | ||||
$map[$property] = 'phid'; | $map[$property] = 'phid'; | ||||
continue; | continue; | ||||
} | } | ||||
// If the column is named `somethingID`, infer it is an ID. | // If the column is named `somethingID`, infer it is an ID. | ||||
if (preg_match('/[a-z]ID$/', $property)) { | if (preg_match('/[a-z]ID$/', $property)) { | ||||
Show All 24 Lines | foreach ($this->getAllLiskProperties() as $property) { | ||||
); | ); | ||||
break; | break; | ||||
case 'phid': | case 'phid': | ||||
$default_map['key_phid'] = array( | $default_map['key_phid'] = array( | ||||
'columns' => array('phid'), | 'columns' => array('phid'), | ||||
'unique' => true, | 'unique' => true, | ||||
); | ); | ||||
break; | break; | ||||
case 'spacePHID': | |||||
$default_map['key_space'] = array( | |||||
'columns' => array('spacePHID'), | |||||
); | |||||
break; | |||||
} | } | ||||
} | } | ||||
return $custom_map + $default_map; | return $custom_map + $default_map; | ||||
} | } | ||||
} | } |