本文整理匯總了PHP中DocumentType::getId方法的典型用法代碼示例。如果您正苦於以下問題:PHP DocumentType::getId方法的具體用法?PHP DocumentType::getId怎麽用?PHP DocumentType::getId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類DocumentType
的用法示例。
在下文中一共展示了DocumentType::getId方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: filterByDocumentType
/**
* Filter the query by a related DocumentType object
*
* @param DocumentType|PropelObjectCollection $documentType The related object(s) to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return DocumentQuery The current query, for fluid interface
* @throws PropelException - if the provided filter is invalid.
*/
public function filterByDocumentType($documentType, $comparison = null)
{
if ($documentType instanceof DocumentType) {
return $this->addUsingAlias(DocumentPeer::DOCUMENT_TYPE_ID, $documentType->getId(), $comparison);
} elseif ($documentType instanceof PropelObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this->addUsingAlias(DocumentPeer::DOCUMENT_TYPE_ID, $documentType->toKeyValue('PrimaryKey', 'Id'), $comparison);
} else {
throw new PropelException('filterByDocumentType() only accepts arguments of type DocumentType or PropelCollection');
}
}
示例2: acceptsURL
public function acceptsURL($sUrl, $bCreateType = false)
{
$sFileName = substr($sUrl, strrpos($sUrl, '/') + 1);
$aName = explode('.', $sFileName);
$sExtension = null;
if (count($aName) > 1) {
$sExtension = array_pop($aName);
}
$sFileName = implode('.', $aName);
$aHeaders = @get_headers($sUrl, true);
$sMimeType = null;
$oDocumentType = null;
if ($aHeaders && isset($aHeaders['Content-Type'])) {
$sMimeType = $aHeaders['Content-Type'];
$oDocumentType = DocumentTypeQuery::findDocumentTypeByMimetype($sMimeType);
}
if ($oDocumentType === null && $sExtension !== null) {
$oDocumentType = DocumentTypePeer::getDocumentTypeByExtension($sExtension);
}
if ($oDocumentType === null && $bCreateType && $sMimeType && $sExtension) {
$oDocumentType = new DocumentType();
$oDocumentType->setExtension($sExtension);
$oDocumentType->setMimetype($sMimeType);
$oDocumentType->save();
}
if ($oDocumentType === null) {
throw new LocalizedException("wns.file_upload.document_type_not_found", array('extension' => $sExtension, 'mimetype' => $sMimeType));
}
return $oDocumentType->getId();
}
示例3: prune
/**
* Exclude object from result
*
* @param DocumentType $documentType Object to remove from the list of results
*
* @return DocumentTypeQuery The current query, for fluid interface
*/
public function prune($documentType = null)
{
if ($documentType) {
$this->addUsingAlias(DocumentTypePeer::ID, $documentType->getId(), Criteria::NOT_EQUAL);
}
return $this;
}
示例4: array
if (isset($_REQUEST['save'])) {
// handle ajax save request (do not show the interface)
$ID = @$_REQUEST['ID'];
// we posted . characters, but something converts them to _ (HTTP 1.1 standard)
$r = array();
foreach ($_REQUEST as $i => $v) {
$r[join('.', explode('_', $i))] = $v;
//convert _ back to .
}
$typeDocument = array();
for ($i0 = 0; isset($r['0.' . $i0]); $i0++) {
$typeDocument[$i0] = array('id' => @$r['0.' . $i0 . '.0'], 'nr' => @$r['0.' . $i0 . '.0']);
}
$DocumentType = new DocumentType($ID, $typeDocument);
if ($DocumentType->save() !== false) {
die('ok:' . $_SERVER['PHP_SELF'] . '?DocumentType=' . urlencode($DocumentType->getId()));
} else {
die('');
}
exit;
// do not show the interface
}
$buttons = "";
if (isset($_REQUEST['new'])) {
$new = true;
} else {
$new = false;
}
if (isset($_REQUEST['edit']) || $new) {
$edit = true;
} else {
示例5: addInstanceToPool
/**
* Adds an object to the instance pool.
*
* Propel keeps cached copies of objects in an instance pool when they are retrieved
* from the database. In some cases -- especially when you override doSelect*()
* methods in your stub classes -- you may need to explicitly add objects
* to the cache in order to ensure that the same objects are always returned by doSelect*()
* and retrieveByPK*() calls.
*
* @param DocumentType $obj A DocumentType object.
* @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally).
*/
public static function addInstanceToPool($obj, $key = null)
{
if (Propel::isInstancePoolingEnabled()) {
if ($key === null) {
$key = (string) $obj->getId();
}
// if key === null
DocumentTypePeer::$instances[$key] = $obj;
}
}
示例6: setDocumentType
/**
* Declares an association between this object and a DocumentType object.
*
* @param DocumentType $v
* @return Document The current object (for fluent API support)
* @throws PropelException
*/
public function setDocumentType(DocumentType $v = null)
{
if ($v === null) {
$this->setDocumentTypeId(NULL);
} else {
$this->setDocumentTypeId($v->getId());
}
$this->aDocumentType = $v;
// Add binding for other direction of this n:n relationship.
// If this object has already been added to the DocumentType object, it will not be re-added.
if ($v !== null) {
$v->addDocument($this);
}
return $this;
}