本文整理汇总了PHP中Operation::InstantiateDbRow方法的典型用法代码示例。如果您正苦于以下问题:PHP Operation::InstantiateDbRow方法的具体用法?PHP Operation::InstantiateDbRow怎么用?PHP Operation::InstantiateDbRow使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Operation
的用法示例。
在下文中一共展示了Operation::InstantiateDbRow方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: InstantiateDbRow
/**
* Instantiate a Parameter from a Database Row.
* Takes in an optional strAliasPrefix, used in case another Object::InstantiateDbRow
* is calling this Parameter::InstantiateDbRow in order to perform
* early binding on referenced objects.
* @param DatabaseRowBase $objDbRow
* @param string $strAliasPrefix
* @return Parameter
*/
public static function InstantiateDbRow($objDbRow, $strAliasPrefix = null, $strExpandAsArrayNodes = null, $objPreviousItem = null)
{
// If blank row, return null
if (!$objDbRow) {
return null;
}
// Create a new instance of the Parameter object
$objToReturn = new Parameter();
$objToReturn->__blnRestored = true;
$objToReturn->intId = $objDbRow->GetColumn($strAliasPrefix . 'id', 'Integer');
$objToReturn->intOperationId = $objDbRow->GetColumn($strAliasPrefix . 'operation_id', 'Integer');
$objToReturn->intOrderNumber = $objDbRow->GetColumn($strAliasPrefix . 'order_number', 'Integer');
$objToReturn->intVariableId = $objDbRow->GetColumn($strAliasPrefix . 'variable_id', 'Integer');
$objToReturn->blnReferenceFlag = $objDbRow->GetColumn($strAliasPrefix . 'reference_flag', 'Bit');
// Instantiate Virtual Attributes
foreach ($objDbRow->GetColumnNameArray() as $strColumnName => $mixValue) {
$strVirtualPrefix = $strAliasPrefix . '__';
$strVirtualPrefixLength = strlen($strVirtualPrefix);
if (substr($strColumnName, 0, $strVirtualPrefixLength) == $strVirtualPrefix) {
$objToReturn->__strVirtualAttributeArray[substr($strColumnName, $strVirtualPrefixLength)] = $mixValue;
}
}
// Prepare to Check for Early/Virtual Binding
if (!$strAliasPrefix) {
$strAliasPrefix = 'parameter__';
}
// Check for Operation Early Binding
if (!is_null($objDbRow->GetColumn($strAliasPrefix . 'operation_id__id'))) {
$objToReturn->objOperation = Operation::InstantiateDbRow($objDbRow, $strAliasPrefix . 'operation_id__', $strExpandAsArrayNodes);
}
// Check for Variable Early Binding
if (!is_null($objDbRow->GetColumn($strAliasPrefix . 'variable_id__id'))) {
$objToReturn->objVariable = Variable::InstantiateDbRow($objDbRow, $strAliasPrefix . 'variable_id__', $strExpandAsArrayNodes);
}
return $objToReturn;
}
示例2: InstantiateDbRow
/**
* Instantiate a Variable from a Database Row.
* Takes in an optional strAliasPrefix, used in case another Object::InstantiateDbRow
* is calling this Variable::InstantiateDbRow in order to perform
* early binding on referenced objects.
* @param DatabaseRowBase $objDbRow
* @param string $strAliasPrefix
* @return Variable
*/
public static function InstantiateDbRow($objDbRow, $strAliasPrefix = null, $strExpandAsArrayNodes = null, $objPreviousItem = null)
{
// If blank row, return null
if (!$objDbRow) {
return null;
}
// See if we're doing an array expansion on the previous item
if ($strExpandAsArrayNodes && $objPreviousItem && $objPreviousItem->intId == $objDbRow->GetColumn($strAliasPrefix . 'id', 'Integer')) {
// We are. Now, prepare to check for ExpandAsArray clauses
$blnExpandedViaArray = false;
if (!$strAliasPrefix) {
$strAliasPrefix = 'variable__';
}
if (array_key_exists($strAliasPrefix . 'operationasreturn__id', $strExpandAsArrayNodes) && !is_null($objDbRow->GetColumn($strAliasPrefix . 'operationasreturn__id'))) {
if ($intPreviousChildItemCount = count($objPreviousItem->_objOperationAsReturnArray)) {
$objPreviousChildItem = $objPreviousItem->_objOperationAsReturnArray[$intPreviousChildItemCount - 1];
$objChildItem = Operation::InstantiateDbRow($objDbRow, $strAliasPrefix . 'operationasreturn__', $strExpandAsArrayNodes, $objPreviousChildItem);
if ($objChildItem) {
array_push($objPreviousItem->_objOperationAsReturnArray, $objChildItem);
}
} else {
array_push($objPreviousItem->_objOperationAsReturnArray, Operation::InstantiateDbRow($objDbRow, $strAliasPrefix . 'operationasreturn__', $strExpandAsArrayNodes));
}
$blnExpandedViaArray = true;
}
if (array_key_exists($strAliasPrefix . 'operationasadditional__id', $strExpandAsArrayNodes) && !is_null($objDbRow->GetColumn($strAliasPrefix . 'operationasadditional__id'))) {
if ($intPreviousChildItemCount = count($objPreviousItem->_objOperationAsAdditionalArray)) {
$objPreviousChildItem = $objPreviousItem->_objOperationAsAdditionalArray[$intPreviousChildItemCount - 1];
$objChildItem = Operation::InstantiateDbRow($objDbRow, $strAliasPrefix . 'operationasadditional__', $strExpandAsArrayNodes, $objPreviousChildItem);
if ($objChildItem) {
array_push($objPreviousItem->_objOperationAsAdditionalArray, $objChildItem);
}
} else {
array_push($objPreviousItem->_objOperationAsAdditionalArray, Operation::InstantiateDbRow($objDbRow, $strAliasPrefix . 'operationasadditional__', $strExpandAsArrayNodes));
}
$blnExpandedViaArray = true;
}
// Either return false to signal array expansion, or check-to-reset the Alias prefix and move on
if ($blnExpandedViaArray) {
return false;
} else {
if ($strAliasPrefix == 'variable__') {
$strAliasPrefix = null;
}
}
}
// Create a new instance of the Variable object
$objToReturn = new Variable();
$objToReturn->__blnRestored = true;
$objToReturn->intId = $objDbRow->GetColumn($strAliasPrefix . 'id', 'Integer');
$objToReturn->strName = $objDbRow->GetColumn($strAliasPrefix . 'name', 'VarChar');
$objToReturn->intVariableTypeId = $objDbRow->GetColumn($strAliasPrefix . 'variable_type_id', 'Integer');
$objToReturn->intObjectTypeId = $objDbRow->GetColumn($strAliasPrefix . 'object_type_id', 'Integer');
$objToReturn->blnArrayFlag = $objDbRow->GetColumn($strAliasPrefix . 'array_flag', 'Bit');
$objToReturn->strDefaultValue = $objDbRow->GetColumn($strAliasPrefix . 'default_value', 'VarChar');
$objToReturn->strFirstVersion = $objDbRow->GetColumn($strAliasPrefix . 'first_version', 'VarChar');
$objToReturn->strLastVersion = $objDbRow->GetColumn($strAliasPrefix . 'last_version', 'VarChar');
$objToReturn->strShortDescription = $objDbRow->GetColumn($strAliasPrefix . 'short_description', 'Blob');
$objToReturn->strExtendedDescription = $objDbRow->GetColumn($strAliasPrefix . 'extended_description', 'Blob');
// Instantiate Virtual Attributes
foreach ($objDbRow->GetColumnNameArray() as $strColumnName => $mixValue) {
$strVirtualPrefix = $strAliasPrefix . '__';
$strVirtualPrefixLength = strlen($strVirtualPrefix);
if (substr($strColumnName, 0, $strVirtualPrefixLength) == $strVirtualPrefix) {
$objToReturn->__strVirtualAttributeArray[substr($strColumnName, $strVirtualPrefixLength)] = $mixValue;
}
}
// Prepare to Check for Early/Virtual Binding
if (!$strAliasPrefix) {
$strAliasPrefix = 'variable__';
}
// Check for ObjectType Early Binding
if (!is_null($objDbRow->GetColumn($strAliasPrefix . 'object_type_id__id'))) {
$objToReturn->objObjectType = QcodoClass::InstantiateDbRow($objDbRow, $strAliasPrefix . 'object_type_id__', $strExpandAsArrayNodes);
}
// Check for ClassProperty Unique ReverseReference Binding
if ($objDbRow->ColumnExists($strAliasPrefix . 'classproperty__id')) {
if (!is_null($objDbRow->GetColumn($strAliasPrefix . 'classproperty__id'))) {
$objToReturn->objClassProperty = ClassProperty::InstantiateDbRow($objDbRow, $strAliasPrefix . 'classproperty__', $strExpandAsArrayNodes);
} else {
// We ATTEMPTED to do an Early Bind but the Object Doesn't Exist
// Let's set to FALSE so that the object knows not to try and re-query again
$objToReturn->objClassProperty = false;
}
}
// Check for ClassVariable Unique ReverseReference Binding
if ($objDbRow->ColumnExists($strAliasPrefix . 'classvariable__id')) {
if (!is_null($objDbRow->GetColumn($strAliasPrefix . 'classvariable__id'))) {
$objToReturn->objClassVariable = ClassVariable::InstantiateDbRow($objDbRow, $strAliasPrefix . 'classvariable__', $strExpandAsArrayNodes);
} else {
// We ATTEMPTED to do an Early Bind but the Object Doesn't Exist
//.........这里部分代码省略.........
示例3: InstantiateDbRow
/**
* Instantiate a QcodoInterface from a Database Row.
* Takes in an optional strAliasPrefix, used in case another Object::InstantiateDbRow
* is calling this QcodoInterface::InstantiateDbRow in order to perform
* early binding on referenced objects.
* @param DatabaseRowBase $objDbRow
* @param string $strAliasPrefix
* @return QcodoInterface
*/
public static function InstantiateDbRow($objDbRow, $strAliasPrefix = null, $strExpandAsArrayNodes = null, $objPreviousItem = null)
{
// If blank row, return null
if (!$objDbRow) {
return null;
}
// See if we're doing an array expansion on the previous item
if ($strExpandAsArrayNodes && $objPreviousItem && $objPreviousItem->intId == $objDbRow->GetColumn($strAliasPrefix . 'id', 'Integer')) {
// We are. Now, prepare to check for ExpandAsArray clauses
$blnExpandedViaArray = false;
if (!$strAliasPrefix) {
$strAliasPrefix = 'qcodo_interface__';
}
if (array_key_exists($strAliasPrefix . 'operation__id', $strExpandAsArrayNodes) && !is_null($objDbRow->GetColumn($strAliasPrefix . 'operation__id'))) {
if ($intPreviousChildItemCount = count($objPreviousItem->_objOperationArray)) {
$objPreviousChildItem = $objPreviousItem->_objOperationArray[$intPreviousChildItemCount - 1];
$objChildItem = Operation::InstantiateDbRow($objDbRow, $strAliasPrefix . 'operation__', $strExpandAsArrayNodes, $objPreviousChildItem);
if ($objChildItem) {
array_push($objPreviousItem->_objOperationArray, $objChildItem);
}
} else {
array_push($objPreviousItem->_objOperationArray, Operation::InstantiateDbRow($objDbRow, $strAliasPrefix . 'operation__', $strExpandAsArrayNodes));
}
$blnExpandedViaArray = true;
}
if (array_key_exists($strAliasPrefix . 'qcodoclassasinterface__id', $strExpandAsArrayNodes) && !is_null($objDbRow->GetColumn($strAliasPrefix . 'qcodoclassasinterface__id'))) {
if ($intPreviousChildItemCount = count($objPreviousItem->_objQcodoClassAsInterfaceArray)) {
$objPreviousChildItem = $objPreviousItem->_objQcodoClassAsInterfaceArray[$intPreviousChildItemCount - 1];
$objChildItem = QcodoClass::InstantiateDbRow($objDbRow, $strAliasPrefix . 'qcodoclassasinterface__', $strExpandAsArrayNodes, $objPreviousChildItem);
if ($objChildItem) {
array_push($objPreviousItem->_objQcodoClassAsInterfaceArray, $objChildItem);
}
} else {
array_push($objPreviousItem->_objQcodoClassAsInterfaceArray, QcodoClass::InstantiateDbRow($objDbRow, $strAliasPrefix . 'qcodoclassasinterface__', $strExpandAsArrayNodes));
}
$blnExpandedViaArray = true;
}
if (array_key_exists($strAliasPrefix . 'childqcodointerface__id', $strExpandAsArrayNodes) && !is_null($objDbRow->GetColumn($strAliasPrefix . 'childqcodointerface__id'))) {
if ($intPreviousChildItemCount = count($objPreviousItem->_objChildQcodoInterfaceArray)) {
$objPreviousChildItem = $objPreviousItem->_objChildQcodoInterfaceArray[$intPreviousChildItemCount - 1];
$objChildItem = QcodoInterface::InstantiateDbRow($objDbRow, $strAliasPrefix . 'childqcodointerface__', $strExpandAsArrayNodes, $objPreviousChildItem);
if ($objChildItem) {
array_push($objPreviousItem->_objChildQcodoInterfaceArray, $objChildItem);
}
} else {
array_push($objPreviousItem->_objChildQcodoInterfaceArray, QcodoInterface::InstantiateDbRow($objDbRow, $strAliasPrefix . 'childqcodointerface__', $strExpandAsArrayNodes));
}
$blnExpandedViaArray = true;
}
// Either return false to signal array expansion, or check-to-reset the Alias prefix and move on
if ($blnExpandedViaArray) {
return false;
} else {
if ($strAliasPrefix == 'qcodo_interface__') {
$strAliasPrefix = null;
}
}
}
// Create a new instance of the QcodoInterface object
$objToReturn = new QcodoInterface();
$objToReturn->__blnRestored = true;
$objToReturn->intId = $objDbRow->GetColumn($strAliasPrefix . 'id', 'Integer');
$objToReturn->intParentQcodoInterfaceId = $objDbRow->GetColumn($strAliasPrefix . 'parent_qcodo_interface_id', 'Integer');
$objToReturn->intClassGroupId = $objDbRow->GetColumn($strAliasPrefix . 'class_group_id', 'Integer');
$objToReturn->strName = $objDbRow->GetColumn($strAliasPrefix . 'name', 'VarChar');
$objToReturn->strFirstVersion = $objDbRow->GetColumn($strAliasPrefix . 'first_version', 'VarChar');
$objToReturn->strLastVersion = $objDbRow->GetColumn($strAliasPrefix . 'last_version', 'VarChar');
$objToReturn->strShortDescription = $objDbRow->GetColumn($strAliasPrefix . 'short_description', 'Blob');
$objToReturn->strExtendedDescription = $objDbRow->GetColumn($strAliasPrefix . 'extended_description', 'Blob');
$objToReturn->intFileId = $objDbRow->GetColumn($strAliasPrefix . 'file_id', 'Integer');
// Instantiate Virtual Attributes
foreach ($objDbRow->GetColumnNameArray() as $strColumnName => $mixValue) {
$strVirtualPrefix = $strAliasPrefix . '__';
$strVirtualPrefixLength = strlen($strVirtualPrefix);
if (substr($strColumnName, 0, $strVirtualPrefixLength) == $strVirtualPrefix) {
$objToReturn->__strVirtualAttributeArray[substr($strColumnName, $strVirtualPrefixLength)] = $mixValue;
}
}
// Prepare to Check for Early/Virtual Binding
if (!$strAliasPrefix) {
$strAliasPrefix = 'qcodo_interface__';
}
// Check for ParentQcodoInterface Early Binding
if (!is_null($objDbRow->GetColumn($strAliasPrefix . 'parent_qcodo_interface_id__id'))) {
$objToReturn->objParentQcodoInterface = QcodoInterface::InstantiateDbRow($objDbRow, $strAliasPrefix . 'parent_qcodo_interface_id__', $strExpandAsArrayNodes);
}
// Check for ClassGroup Early Binding
if (!is_null($objDbRow->GetColumn($strAliasPrefix . 'class_group_id__id'))) {
$objToReturn->objClassGroup = ClassGroup::InstantiateDbRow($objDbRow, $strAliasPrefix . 'class_group_id__', $strExpandAsArrayNodes);
}
// Check for File Early Binding
//.........这里部分代码省略.........
示例4: InstantiateDbResult
/**
* Instantiate an array of Operations from a Database Result
* @param DatabaseResultBase $objDbResult
* @return Operation[]
*/
public static function InstantiateDbResult(QDatabaseResultBase $objDbResult, $strExpandAsArrayNodes = null)
{
$objToReturn = array();
// If blank resultset, then return empty array
if (!$objDbResult) {
return $objToReturn;
}
// Load up the return array with each row
if ($strExpandAsArrayNodes) {
$objLastRowItem = null;
while ($objDbRow = $objDbResult->GetNextRow()) {
$objItem = Operation::InstantiateDbRow($objDbRow, null, $strExpandAsArrayNodes, $objLastRowItem);
if ($objItem) {
array_push($objToReturn, $objItem);
$objLastRowItem = $objItem;
}
}
} else {
while ($objDbRow = $objDbResult->GetNextRow()) {
array_push($objToReturn, Operation::InstantiateDbRow($objDbRow));
}
}
return $objToReturn;
}
示例5: InstantiateDbRow
/**
* Instantiate a File from a Database Row.
* Takes in an optional strAliasPrefix, used in case another Object::InstantiateDbRow
* is calling this File::InstantiateDbRow in order to perform
* early binding on referenced objects.
* @param DatabaseRowBase $objDbRow
* @param string $strAliasPrefix
* @return File
*/
public static function InstantiateDbRow($objDbRow, $strAliasPrefix = null, $strExpandAsArrayNodes = null, $objPreviousItem = null)
{
// If blank row, return null
if (!$objDbRow) {
return null;
}
// See if we're doing an array expansion on the previous item
if ($strExpandAsArrayNodes && $objPreviousItem && $objPreviousItem->intId == $objDbRow->GetColumn($strAliasPrefix . 'id', 'Integer')) {
// We are. Now, prepare to check for ExpandAsArray clauses
$blnExpandedViaArray = false;
if (!$strAliasPrefix) {
$strAliasPrefix = 'file__';
}
if (array_key_exists($strAliasPrefix . 'operation__id', $strExpandAsArrayNodes) && !is_null($objDbRow->GetColumn($strAliasPrefix . 'operation__id'))) {
if ($intPreviousChildItemCount = count($objPreviousItem->_objOperationArray)) {
$objPreviousChildItem = $objPreviousItem->_objOperationArray[$intPreviousChildItemCount - 1];
$objChildItem = Operation::InstantiateDbRow($objDbRow, $strAliasPrefix . 'operation__', $strExpandAsArrayNodes, $objPreviousChildItem);
if ($objChildItem) {
array_push($objPreviousItem->_objOperationArray, $objChildItem);
}
} else {
array_push($objPreviousItem->_objOperationArray, Operation::InstantiateDbRow($objDbRow, $strAliasPrefix . 'operation__', $strExpandAsArrayNodes));
}
$blnExpandedViaArray = true;
}
if (array_key_exists($strAliasPrefix . 'qcodoclass__id', $strExpandAsArrayNodes) && !is_null($objDbRow->GetColumn($strAliasPrefix . 'qcodoclass__id'))) {
if ($intPreviousChildItemCount = count($objPreviousItem->_objQcodoClassArray)) {
$objPreviousChildItem = $objPreviousItem->_objQcodoClassArray[$intPreviousChildItemCount - 1];
$objChildItem = QcodoClass::InstantiateDbRow($objDbRow, $strAliasPrefix . 'qcodoclass__', $strExpandAsArrayNodes, $objPreviousChildItem);
if ($objChildItem) {
array_push($objPreviousItem->_objQcodoClassArray, $objChildItem);
}
} else {
array_push($objPreviousItem->_objQcodoClassArray, QcodoClass::InstantiateDbRow($objDbRow, $strAliasPrefix . 'qcodoclass__', $strExpandAsArrayNodes));
}
$blnExpandedViaArray = true;
}
if (array_key_exists($strAliasPrefix . 'qcodoconstant__id', $strExpandAsArrayNodes) && !is_null($objDbRow->GetColumn($strAliasPrefix . 'qcodoconstant__id'))) {
if ($intPreviousChildItemCount = count($objPreviousItem->_objQcodoConstantArray)) {
$objPreviousChildItem = $objPreviousItem->_objQcodoConstantArray[$intPreviousChildItemCount - 1];
$objChildItem = QcodoConstant::InstantiateDbRow($objDbRow, $strAliasPrefix . 'qcodoconstant__', $strExpandAsArrayNodes, $objPreviousChildItem);
if ($objChildItem) {
array_push($objPreviousItem->_objQcodoConstantArray, $objChildItem);
}
} else {
array_push($objPreviousItem->_objQcodoConstantArray, QcodoConstant::InstantiateDbRow($objDbRow, $strAliasPrefix . 'qcodoconstant__', $strExpandAsArrayNodes));
}
$blnExpandedViaArray = true;
}
if (array_key_exists($strAliasPrefix . 'qcodointerface__id', $strExpandAsArrayNodes) && !is_null($objDbRow->GetColumn($strAliasPrefix . 'qcodointerface__id'))) {
if ($intPreviousChildItemCount = count($objPreviousItem->_objQcodoInterfaceArray)) {
$objPreviousChildItem = $objPreviousItem->_objQcodoInterfaceArray[$intPreviousChildItemCount - 1];
$objChildItem = QcodoInterface::InstantiateDbRow($objDbRow, $strAliasPrefix . 'qcodointerface__', $strExpandAsArrayNodes, $objPreviousChildItem);
if ($objChildItem) {
array_push($objPreviousItem->_objQcodoInterfaceArray, $objChildItem);
}
} else {
array_push($objPreviousItem->_objQcodoInterfaceArray, QcodoInterface::InstantiateDbRow($objDbRow, $strAliasPrefix . 'qcodointerface__', $strExpandAsArrayNodes));
}
$blnExpandedViaArray = true;
}
// Either return false to signal array expansion, or check-to-reset the Alias prefix and move on
if ($blnExpandedViaArray) {
return false;
} else {
if ($strAliasPrefix == 'file__') {
$strAliasPrefix = null;
}
}
}
// Create a new instance of the File object
$objToReturn = new File();
$objToReturn->__blnRestored = true;
$objToReturn->intId = $objDbRow->GetColumn($strAliasPrefix . 'id', 'Integer');
$objToReturn->intDirectoryId = $objDbRow->GetColumn($strAliasPrefix . 'directory_id', 'Integer');
$objToReturn->strPath = $objDbRow->GetColumn($strAliasPrefix . 'path', 'VarChar');
$objToReturn->intDeprecatedMajorVersion = $objDbRow->GetColumn($strAliasPrefix . 'deprecated_major_version', 'Integer');
$objToReturn->intDeprecatedMinorVersion = $objDbRow->GetColumn($strAliasPrefix . 'deprecated_minor_version', 'Integer');
$objToReturn->intDeprecatedBuild = $objDbRow->GetColumn($strAliasPrefix . 'deprecated_build', 'Integer');
// Instantiate Virtual Attributes
foreach ($objDbRow->GetColumnNameArray() as $strColumnName => $mixValue) {
$strVirtualPrefix = $strAliasPrefix . '__';
$strVirtualPrefixLength = strlen($strVirtualPrefix);
if (substr($strColumnName, 0, $strVirtualPrefixLength) == $strVirtualPrefix) {
$objToReturn->__strVirtualAttributeArray[substr($strColumnName, $strVirtualPrefixLength)] = $mixValue;
}
}
// Prepare to Check for Early/Virtual Binding
if (!$strAliasPrefix) {
$strAliasPrefix = 'file__';
}
//.........这里部分代码省略.........