本文整理汇总了PHP中InputDocument::isNew方法的典型用法代码示例。如果您正苦于以下问题:PHP InputDocument::isNew方法的具体用法?PHP InputDocument::isNew怎么用?PHP InputDocument::isNew使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类InputDocument
的用法示例。
在下文中一共展示了InputDocument::isNew方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: doValidate
/**
* Validates all modified columns of given InputDocument 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 InputDocument $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(InputDocument $obj, $cols = null)
{
$columns = array();
if ($cols) {
$dbMap = Propel::getDatabaseMap(InputDocumentPeer::DATABASE_NAME);
$tableMap = $dbMap->getTable(InputDocumentPeer::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(InputDocumentPeer::INP_DOC_UID)) {
$columns[InputDocumentPeer::INP_DOC_UID] = $obj->getInpDocUid();
}
if ($obj->isNew() || $obj->isColumnModified(InputDocumentPeer::PRO_UID)) {
$columns[InputDocumentPeer::PRO_UID] = $obj->getProUid();
}
if ($obj->isNew() || $obj->isColumnModified(InputDocumentPeer::INP_DOC_FORM_NEEDED)) {
$columns[InputDocumentPeer::INP_DOC_FORM_NEEDED] = $obj->getInpDocFormNeeded();
}
if ($obj->isNew() || $obj->isColumnModified(InputDocumentPeer::INP_DOC_ORIGINAL)) {
$columns[InputDocumentPeer::INP_DOC_ORIGINAL] = $obj->getInpDocOriginal();
}
if ($obj->isNew() || $obj->isColumnModified(InputDocumentPeer::INP_DOC_PUBLISHED)) {
$columns[InputDocumentPeer::INP_DOC_PUBLISHED] = $obj->getInpDocPublished();
}
}
return BasePeer::doValidate(InputDocumentPeer::DATABASE_NAME, InputDocumentPeer::TABLE_NAME, $columns);
}