/home/webmaster_pmscp/pharmacymuseumscp.org/includes/ORM/Schema/Types/KeyForTitleType.php
$this->sqlType=$this->castAs;
}
if(array_key_exists('sqlLength', $typeSchema)){
$this->sqlLength=(int)$typeSchema['sqlLength'];
}else if(array_key_exists($this->sqlType, self::$sqlLengthDefaults)){
$this->sqlLength=self::$sqlLengthDefaults[$this->sqlType];
}else{
$this->sqlLength=128;
}
}
public function getNormalized(mixed $value):mixed {
return (string) $value;
}
public function getDetailHtml(\PMSCP\Layout\HTMLRenderer $html, $value):string{
$class = $this->schema['class'];
$variable = $this->schema['variable'];
$keyForTitle= $value;
$val=$class::$$variable[$keyForTitle];
$val = (isset($val))?$val:"[NOT SET]";
$html->h3(\PMSCP\Functional\Core::parseCamelCaseUC($this->field).": ",'detailPageDetail');
$html->p($val,'detailPageDetail');
return $html->getContent();
}
public function saveAsXml(mixed $value):string{
$class = $this->schema['class'];
$variable = $this->schema['variable'];
$key= $value;
$value=$class::$$variable[$key];
$propertyContent = '';
$propertyContent.=\PMSCP\Functional\Core::createXMLTag('field',$this->field);
$propertyContent.=\PMSCP\Functional\Core::createXMLTag('type',static::$type);
$propertyContent.=\PMSCP\Functional\Core::createXMLTag('value',$value);
$property = \PMSCP\Functional\Core::createXMLTag('property',$propertyContent);
return $property;
}
public function saveAsJson(mixed $value):string{
$class = $this->schema['class'];
$variable = $this->schema['variable'];
Arguments
/home/webmaster_pmscp/pharmacymuseumscp.org/includes/ORM/Schema/Types/KeyForTitleType.php
$this->sqlType=$this->castAs;
}
if(array_key_exists('sqlLength', $typeSchema)){
$this->sqlLength=(int)$typeSchema['sqlLength'];
}else if(array_key_exists($this->sqlType, self::$sqlLengthDefaults)){
$this->sqlLength=self::$sqlLengthDefaults[$this->sqlType];
}else{
$this->sqlLength=128;
}
}
public function getNormalized(mixed $value):mixed {
return (string) $value;
}
public function getDetailHtml(\PMSCP\Layout\HTMLRenderer $html, $value):string{
$class = $this->schema['class'];
$variable = $this->schema['variable'];
$keyForTitle= $value;
$val=$class::$$variable[$keyForTitle];
$val = (isset($val))?$val:"[NOT SET]";
$html->h3(\PMSCP\Functional\Core::parseCamelCaseUC($this->field).": ",'detailPageDetail');
$html->p($val,'detailPageDetail');
return $html->getContent();
}
public function saveAsXml(mixed $value):string{
$class = $this->schema['class'];
$variable = $this->schema['variable'];
$key= $value;
$value=$class::$$variable[$key];
$propertyContent = '';
$propertyContent.=\PMSCP\Functional\Core::createXMLTag('field',$this->field);
$propertyContent.=\PMSCP\Functional\Core::createXMLTag('type',static::$type);
$propertyContent.=\PMSCP\Functional\Core::createXMLTag('value',$value);
$property = \PMSCP\Functional\Core::createXMLTag('property',$propertyContent);
return $property;
}
public function saveAsJson(mixed $value):string{
$class = $this->schema['class'];
$variable = $this->schema['variable'];
Arguments
2
"Undefined array key """
"/home/webmaster_pmscp/pharmacymuseumscp.org/includes/ORM/Schema/Types/KeyForTitleType.php"
72
/home/webmaster_pmscp/pharmacymuseumscp.org/includes/ORM/DatabaseObjectModel.php
return $html->getContent();
}
public function updateForOutput():void{
}
protected function parseDetails(array $attributeTypes=array()):string{
$this->emptyAttrsToDefaults();
$this->updateForOutput();
if(empty($attributeTypes)){
$attributeTypes=static::$attributeTypes;
}
$html=\PMSCP\Layout\HTMLRenderer::getNew();
$parser = \PMSCP\ORM\Schema\Factory::getNewParser($attributeTypes);
foreach($attributeTypes as $key=>$val){
if(!in_array($key,static::$excludeFromOutput,true)){
// if($key === 'mainImage'){die(var_dump($this->$key));}
$attr = $parser->getType($key);
$attrContent = $attr->getDetailHtml(\PMSCP\Layout\HTMLRenderer::getNew(),$this->$key);
$html->addToContent($attrContent);
$html->br();
}
}
return $html->getContent();
}
public function generateDetailsString():string{
$html=\PMSCP\Layout\HTMLRenderer::getNew();
$html->addToContent($this->parseDetails(static::$attributeTypes));
// $html->hr();
$html->addToContent(static::getManagementDivString(false));
return $html->getContent();
}
public function outputDetails():void {
$html=\PMSCP\Layout\HTMLRenderer::getNew();
$html->openTag('div',array('id'=>"Details_".static::$tableName."_".$this->getId()));
$html->spacer2em();
$html->addToContent($this->generateDetailsString());
$html->closeTag('div');
Arguments
PMSCP\Layout\HTMLRenderer {#56}
""
/home/webmaster_pmscp/pharmacymuseumscp.org/includes/ORM/DatabaseObjectModel.php
if(empty($attributeTypes)){
$attributeTypes=static::$attributeTypes;
}
$html=\PMSCP\Layout\HTMLRenderer::getNew();
$parser = \PMSCP\ORM\Schema\Factory::getNewParser($attributeTypes);
foreach($attributeTypes as $key=>$val){
if(!in_array($key,static::$excludeFromOutput,true)){
// if($key === 'mainImage'){die(var_dump($this->$key));}
$attr = $parser->getType($key);
$attrContent = $attr->getDetailHtml(\PMSCP\Layout\HTMLRenderer::getNew(),$this->$key);
$html->addToContent($attrContent);
$html->br();
}
}
return $html->getContent();
}
public function generateDetailsString():string{
$html=\PMSCP\Layout\HTMLRenderer::getNew();
$html->addToContent($this->parseDetails(static::$attributeTypes));
// $html->hr();
$html->addToContent(static::getManagementDivString(false));
return $html->getContent();
}
public function outputDetails():void {
$html=\PMSCP\Layout\HTMLRenderer::getNew();
$html->openTag('div',array('id'=>"Details_".static::$tableName."_".$this->getId()));
$html->spacer2em();
$html->addToContent($this->generateDetailsString());
$html->closeTag('div');
$html->echoContent();
}
public static function getIdName():string{
return static::$idName;
}
public static function isValidId(int $id):bool{
$database=\PMSCP\Database\Database::getDb();
$sql = \PMSCP\Database\SqlBuilder::getNew(\PMSCP\Database\Database::getType());
$sql->select(static::$tableName,'COUNT(*)')
Arguments
array:21 [
"objectId" => array:3 [
"type" => "basic"
"castAs" => "int"
"sqlLength" => 9
]
"accessionNumber" => array:3 [
"type" => "basic"
"castAs" => "string"
"sqlLength" => 255
]
"nameTitle" => array:3 [
"type" => "basic"
"castAs" => "string"
"sqlLength" => 1024
]
"description" => array:2 [
"type" => "text"
"castAs" => "string"
]
"keywords" => array:3 [
"type" => "keywordLink"
"href" => "search/keywordFast/?kw="
"castAs" => "string"
]
"height" => array:3 [
"type" => "basic"
"unit" => "cm"
"castAs" => "float"
]
"width" => array:3 [
"type" => "basic"
"unit" => "cm"
"castAs" => "float"
]
"depth" => array:3 [
"type" => "basic"
"unit" => "cm"
"castAs" => "float"
]
"objectType" => array:5 [
"type" => "keyForTitle"
"class" => "\PMSCP\ORM\ObjectTypes\MuseumObject"
"variable" => "objectTypes"
"castAs" => "string"
"sqlLength" => 50
]
"timeframe" => array:5 [
"type" => "keyForTitle"
"class" => "\PMSCP\ORM\ObjectTypes\MuseumObject"
"variable" => "timeframeTitles"
"castAs" => "string"
"sqlLength" => 50
]
"objectCondition" => array:3 [
"type" => "basic"
"castAs" => "string"
"sqlLength" => 255
]
"quantity" => array:3 [
"type" => "basic"
"castAs" => "int"
"sqlLength" => 9
]
"curatorNotes" => array:2 [
"type" => "text"
"castAs" => "string"
]
"locationInStorage" => array:3 [
"type" => "basic"
"castAs" => "string"
"sqlLength" => 1024
]
"objectNumber" => array:3 [
"type" => "basic"
"castAs" => "int"
"sqlLength" => 9
]
"dateAdded" => array:4 [
"type" => "timeToString"
"format" => "m/d/Y"
"castAs" => "int"
"sqlLength" => 11
]
"dateCollected" => array:4 [
"type" => "timeToString"
"format" => "m/d/Y"
"castAs" => "int"
"sqlLength" => 50
]
"mainImage" => array:4 [
"type" => "image"
"baseDir" => "images/objectImages"
"castAs" => "string"
"sqlLength" => 512
]
"collectionId" => array:6 [
"type" => "object"
"class" => "\PMSCP\ORM\Collection"
"className" => "Collection"
"castAs" => "int"
"useSummary" => true
"sqlLength" => 9
]
"donorId" => array:6 [
"type" => "object"
"class" => "\PMSCP\ORM\Donor"
"className" => "Donor"
"castAs" => "int"
"useSummary" => true
"sqlLength" => 9
]
"addedById" => array:6 [
"type" => "object"
"class" => "\PMSCP\ORM\UserTypes\User"
"className" => "User"
"castAs" => "int"
"sqlLength" => 9
"altTitle" => "Added By"
]
]
/home/webmaster_pmscp/pharmacymuseumscp.org/includes/ORM/DatabaseObjectModel.php
$attrContent = $attr->getDetailHtml(\PMSCP\Layout\HTMLRenderer::getNew(),$this->$key);
$html->addToContent($attrContent);
$html->br();
}
}
return $html->getContent();
}
public function generateDetailsString():string{
$html=\PMSCP\Layout\HTMLRenderer::getNew();
$html->addToContent($this->parseDetails(static::$attributeTypes));
// $html->hr();
$html->addToContent(static::getManagementDivString(false));
return $html->getContent();
}
public function outputDetails():void {
$html=\PMSCP\Layout\HTMLRenderer::getNew();
$html->openTag('div',array('id'=>"Details_".static::$tableName."_".$this->getId()));
$html->spacer2em();
$html->addToContent($this->generateDetailsString());
$html->closeTag('div');
$html->echoContent();
}
public static function getIdName():string{
return static::$idName;
}
public static function isValidId(int $id):bool{
$database=\PMSCP\Database\Database::getDb();
$sql = \PMSCP\Database\SqlBuilder::getNew(\PMSCP\Database\Database::getType());
$sql->select(static::$tableName,'COUNT(*)')
->where(static::$idName." ='{$id}'");
$resultArray = $database->query($sql->getSql());
$resSet = $database->fetchArray($resultArray);
$numItems=(int) array_shift($resSet);
$found=false;
if($numItems>0){
$found=true;
}else{
$found=false;
}
/home/webmaster_pmscp/pharmacymuseumscp.org/includes/Views/Template/DetailsView.php
<?php
namespace PMSCP\Views\Template;
class DetailsView extends \PMSCP\Views\AbstractView{
protected \PMSCP\Layout\HTMLRenderer $html;
protected \PMSCP\Layout\LayoutAgent $layoutAgent;
protected array $vars=array();
protected function preproccess():void {
}
protected function processContent():void {
$item = $this->vars['item'];
$item->outputDetails();
}
}
/home/webmaster_pmscp/pharmacymuseumscp.org/includes/Views/AbstractView.php
}
public static function getNew():mixed {
$class = get_called_class();
return new $class();
}
protected function preproccess():void {
}
protected function processHeader():void {
$this->layoutAgent->renderHeader();
}
protected function processFooter():void {
$this->layoutAgent->renderFooter();
}
protected function processContent():void {
}
public function output():void {
$this->processHeader();
$this->processContent();
$this->processFooter();
}
}
/home/webmaster_pmscp/pharmacymuseumscp.org/includes/Response.php
array_unshift($args, 'setcookie');
$this->headers[] = $args;
return true;
}
public function setRawCookie():bool {
$args = func_get_args();
array_unshift($args, 'setrawcookie');
$this->headers[] = $args;
return true;
}
public function getHeaders():array{
return $this->headers;
}
public function send():void {
$viewObject = $this->initView();
$this->sendHeaders();
$viewObject->output();
$this->invokeLastCall();
}
public function setLayoutAgentVars(array $LAvars):void {
$this->initLayoutAgentVars();
foreach($LAvars as $key=>$val){
$this->layoutAgentVars[$key]=$val;
}
}
protected function initLayoutAgentVars():void {
$this->layoutAgentVars = array(
'title' => "Schwartz College of Pharmacy Museum",
'description' => "Schwartz College of Pharmacy Museum",
'sectionMenu' => "default",
'useHeaderImg' => false,
'headerImg' => "9.jpg",
'imgPosition' => "center",
'headerImgText' => "Schwartz College of Pharmacy Museum"
);
}
/home/webmaster_pmscp/pharmacymuseumscp.org/public/frontRouter.php
);
$predefinedRoutes=\PMSCP\Routing\PredefinedRoutes::getRoutes();
$routesToSet = array_merge($routes,$predefinedRoutes);
$router->setRoutes($routesToSet);
$html =\PMSCP\Layout\HTMLRenderer::getNew();
$path = parse_url( $request->getVar('server','REQUEST_URI'), PHP_URL_PATH);
$route = $router->matchPath($path);
$router->parseRoute($route);
$controllerClass=$router->getController();
$controllerClass="\\PMSCP\\Controllers\\".$controllerClass;
$response = \PMSCP\Response::getNew($html);
$request->setRouting($router);
$controller = $controllerClass::getNew($request,$response);
$response = $controller->invokeAction();
//echo $controllerClass;
//die( $router->getAction());
//echo $route;
$response->send();
//echo var_dump($path);