本文整理汇总了PHP中Photo::getId方法的典型用法代码示例。如果您正苦于以下问题:PHP Photo::getId方法的具体用法?PHP Photo::getId怎么用?PHP Photo::getId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Photo
的用法示例。
在下文中一共展示了Photo::getId方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: executeUpload
public function executeUpload(sfWebRequest $request)
{
$result = 'All broken :(';
try {
//@todo: added CSRF check;
$files = $request->getFiles();
$fileData = array_pop($files);
$validator = new sfValidatorFile(array('max_size' => 1024 * 1024, 'mime_types' => array('image/jpeg', 'image/pjpeg', 'image/png', 'image/x-png', 'image/gif', 'application/octet-stream')));
$file = $validator->clean($fileData);
$file instanceof sfValidatedFile;
$uploader = new ImageUploader();
$uploaded = $uploader->login()->upload($file->getTempName());
$photo = new Photo();
$photo->name = $uploaded->image;
$photo->thumb = $uploaded->thumb;
$photo->save();
$result = array('id' => $photo->getId(), 'image' => $uploaded->image, 'thumb' => $uploaded->thumb);
} catch (Exception $e) {
$result = $e->getMessage();
}
return $this->renderText(json_encode($result));
}
示例2: Photo
$photoObj = new Photo();
if (isset($_POST['is_item'])) {
$is_item = '1';
} else {
$is_item = '0';
}
if (isset($_POST['is_photo'])) {
$is_photo = '1';
} else {
$is_photo = '0';
}
$photoObj->setID($_POST['id']);
$photoObj->setDescription($_POST['description']);
$photoObj->setIsItem($is_item);
$photoObj->setIsPhoto($is_photo);
$rowphoto = $photoDao->editOne($photoObj->getId(), $photoObj->getDescription(), $photoObj->getIsItem(), $photoObj->getIsPhoto());
}
?>
<div class="main container-fluid">
<!--div class="section"-->
<?php
while ($row = $showPhotos->fetch_assoc()) {
?>
<div class="secolPhoto">
<table class="table datagrid" style="width: 25%">
<tr style="background-color: chocolate">
<th style="width: 25%"><?php
echo "<a style='color:darkred' href='showPhoto.php?photoid={$row['id']}'> " . $row['id'] . "</a>";
?>
</th>
示例3: loadPrevious
/**
* Load an instance of an Photo entity from the database that corresponds to the previous Photo in Album
*
* @access public
* @param Photo $photo
* @param array $options (Optional) Read documentation on parseOptions for details
* @return Photo
*/
public function loadPrevious(Photo $photo, $options = null)
{
$this->resetQueryStrings();
$this->query_reset_lock = true;
if (!is_array($options) || !array_key_exists("order", $options)) {
$this->query_order = "ORDER BY {$this->tableName}.id DESC";
}
$this->query_where = "WHERE " . $this->getTableName() . ".id < ? AND {$this->tableName}.albumid = ?";
$this->query_params = array($photo->getId(), $photo->getAlbumId());
$result = $this->loadGeneral($options);
$this->query_reset_lock = false;
return $result;
}
示例4: 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 Photo $value A Photo object.
* @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally).
*/
public static function addInstanceToPool(Photo $obj, $key = null)
{
if (Propel::isInstancePoolingEnabled()) {
if ($key === null) {
$key = (string) $obj->getId();
}
// if key === null
self::$instances[$key] = $obj;
}
}
示例5: setPhoto
/**
* Declares an association between this object and a Photo object.
*
* @param Photo $v
* @return ProductHasPhoto The current object (for fluent API support)
* @throws PropelException
*/
public function setPhoto(Photo $v = null)
{
if ($v === null) {
$this->setPhotoId(NULL);
} else {
$this->setPhotoId($v->getId());
}
$this->aPhoto = $v;
// Add binding for other direction of this n:n relationship.
// If this object has already been added to the Photo object, it will not be re-added.
if ($v !== null) {
$v->addProductHasPhoto($this);
}
return $this;
}