本文整理匯總了PHP中OutputDocument::isNew方法的典型用法代碼示例。如果您正苦於以下問題:PHP OutputDocument::isNew方法的具體用法?PHP OutputDocument::isNew怎麽用?PHP OutputDocument::isNew使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類OutputDocument
的用法示例。
在下文中一共展示了OutputDocument::isNew方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: doValidate
/**
* Validates all modified columns of given OutputDocument object.
* If parameter $columns is either a single column name or an array of column names
* than only those columns are validated.
*
* NOTICE: This does not apply to primary or foreign keys for now.
*
* @param OutputDocument $obj The object to validate.
* @param mixed $cols Column name or array of column names.
*
* @return mixed TRUE if all columns are valid or the error message of the first invalid column.
*/
public static function doValidate(OutputDocument $obj, $cols = null)
{
$columns = array();
if ($cols) {
$dbMap = Propel::getDatabaseMap(OutputDocumentPeer::DATABASE_NAME);
$tableMap = $dbMap->getTable(OutputDocumentPeer::TABLE_NAME);
if (!is_array($cols)) {
$cols = array($cols);
}
foreach ($cols as $colName) {
if ($tableMap->containsColumn($colName)) {
$get = 'get' . $tableMap->getColumn($colName)->getPhpName();
$columns[$colName] = $obj->{$get}();
}
}
} else {
if ($obj->isNew() || $obj->isColumnModified(OutputDocumentPeer::OUT_DOC_UID)) {
$columns[OutputDocumentPeer::OUT_DOC_UID] = $obj->getOutDocUid();
}
if ($obj->isNew() || $obj->isColumnModified(OutputDocumentPeer::PRO_UID)) {
$columns[OutputDocumentPeer::PRO_UID] = $obj->getProUid();
}
if ($obj->isNew() || $obj->isColumnModified(OutputDocumentPeer::OUT_DOC_GENERATE)) {
$columns[OutputDocumentPeer::OUT_DOC_GENERATE] = $obj->getOutDocGenerate();
}
if ($obj->isNew() || $obj->isColumnModified(OutputDocumentPeer::OUT_DOC_TYPE)) {
$columns[OutputDocumentPeer::OUT_DOC_TYPE] = $obj->getOutDocType();
}
}
return BasePeer::doValidate(OutputDocumentPeer::DATABASE_NAME, OutputDocumentPeer::TABLE_NAME, $columns);
}