本文整理汇总了PHP中Property::getId方法的典型用法代码示例。如果您正苦于以下问题:PHP Property::getId方法的具体用法?PHP Property::getId怎么用?PHP Property::getId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Property
的用法示例。
在下文中一共展示了Property::getId方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: test_deletion_from_collection_should_destroy_the_active_record
public function test_deletion_from_collection_should_destroy_the_active_record()
{
$Property = new Property(array('description' => 'This is a Property'));
$Picture = $Property->picture->create(array('title' => 'Front'));
$this->assertTrue($Property->save());
$this->assertTrue($Picture instanceof AkActiveRecord);
$Property->picture->delete($Picture);
$StoredProperty = $this->Property->find('first');
$this->assertEqual($Property->getId(), $StoredProperty->getId());
$this->assertFalse($this->Picture->find('first', array('default' => false)));
}
示例2: prune
/**
* Exclude object from result
*
* @param Property $property Object to remove from the list of results
*
* @return PropertyQuery The current query, for fluid interface
*/
public function prune($property = null)
{
if ($property) {
$this->addUsingAlias(PropertyPeer::ID, $property->getId(), Criteria::NOT_EQUAL);
}
return $this;
}
示例3: test_clean_up_dependencies
public function test_clean_up_dependencies()
{
$Property = new Property('description->', 'Luxury Estate');
$PropertyType = new PropertyType();
$this->assertTrue($PropertyType =& $PropertyType->create(array('description' => 'Mansion')));
$Property->property_type->add($PropertyType);
$this->assertTrue($Property->save());
$PropertyType =& $PropertyType->findFirstBy('description', 'Mansion');
$PropertyType->property->load();
$this->assertEqual($PropertyType->properties[0]->getId(), $Property->getId());
$this->assertEqual($PropertyType->property->count(), 1);
$this->assertTrue($Property->destroy());
$PropertyType =& $PropertyType->findFirstBy('description', 'Mansion');
$PropertyType->property->load();
$this->assertTrue(empty($PropertyType->properties[0]));
$this->assertEqual($PropertyType->property->count(), 0);
}
示例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 Property $value A Property object.
* @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally).
*/
public static function addInstanceToPool(Property $obj, $key = null)
{
if (Propel::isInstancePoolingEnabled()) {
if ($key === null) {
$key = (string) $obj->getId();
}
// if key === null
self::$instances[$key] = $obj;
}
}
示例5: saveProperty
/**
* Сохраняет свойство в БД. Если идентификатор Свойств (ID) пустой, то
* добавляет запись в таблицу
* @global type $DB
* @param \Property $property Свойство
* @param string $tableName название таблицы
*/
static function saveProperty($property, $tableName)
{
if ($property->getId() == null) {
TDataBaseDocument::insertProperty($property, $tableName);
} else {
global $DB;
$sql = 'UPDATE ' . $tableName . ' SET PARENT_ID = ' . $property->getParentId() . ', TYPE="' . $DB->EscapeString($property->getType()) . '", VALUE="' . $DB->EscapeString($property->getValue()) . '" WHERE ID = ' . $property->getId();
$DB->Query($sql);
}
}
示例6: do_update
/**
* Updates a property
*
* @param int $id The property ID
* @param array $data
* @return int The property ID
*/
public function do_update($id, $data = null)
{
$user = $this->requireUser();
if (!$user->isAdmin()) {
throw new Exception('Only administrators are allowed to edit properties.');
}
// Validate input data
$validator = new KickstartValidator();
$locale = Localizer::getInstance();
$warnings = $validator->filterErrors($data, $this->initFilter($this->filter_basic, $locale));
if ($warnings) {
return array('result' => false, 'warnings' => $warnings);
}
$query = PropertyQuery::create()->filterByAccount($user->getAccount());
if ($id !== null) {
$query->filterById($id, Criteria::NOT_EQUAL);
$property = PropertyQuery::create()->filterByAccount($user->getAccount())->findOneById($id);
if (!$property) {
throw new Exception('Property not found; ID: ' . $id);
}
} else {
$property = new Property();
}
// Check for duplicates
if (isset($data['Name']) and $query->findOneByName($data['Name'])) {
throw new Exception($locale->insert('error.taken', array('value' => '"' . $data['Name'] . '"')));
}
unset($data['Id']);
$property->fromArray($data);
$property->setAccount($user->getAccount());
$property->save();
return $property->getId();
}
示例7: test_clean_up_dependencies
public function test_clean_up_dependencies()
{
$Property = new Property(array('description' => 'Ruins in Matamon'));
$this->assertTrue($Property->save());
$South =& $Property->picture->create(array('title' => 'South views'));
$this->assertReference($South, $Property->pictures[0]);
$this->assertFalse($South->isNewRecord());
$pic_id = $South->getId();
$Property = new Property($Property->getId());
$this->assertTrue($Property->destroy());
$Picture = new Picture();
$this->assertFalse($Picture->find($pic_id));
}
示例8: filterByProperty
/**
* Filter the query by a related Property object
*
* @param Property|PropelObjectCollection $property The related object(s) to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return PropertyValueQuery The current query, for fluid interface
* @throws PropelException - if the provided filter is invalid.
*/
public function filterByProperty($property, $comparison = null)
{
if ($property instanceof Property) {
return $this->addUsingAlias(PropertyValuePeer::PROPERTY_ID, $property->getId(), $comparison);
} elseif ($property instanceof PropelObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this->addUsingAlias(PropertyValuePeer::PROPERTY_ID, $property->toKeyValue('PrimaryKey', 'Id'), $comparison);
} else {
throw new PropelException('filterByProperty() only accepts arguments of type Property or PropelCollection');
}
}
示例9: setProperty
/**
* Declares an association between this object and a Property object.
*
* @param Property $v
* @return PropertyValue The current object (for fluent API support)
* @throws PropelException
*/
public function setProperty(Property $v = null)
{
if ($v === null) {
$this->setPropertyId(NULL);
} else {
$this->setPropertyId($v->getId());
}
$this->aProperty = $v;
// Add binding for other direction of this n:n relationship.
// If this object has already been added to the Property object, it will not be re-added.
if ($v !== null) {
$v->addPropertyValue($this);
}
return $this;
}
示例10: array
<div class="property-viewed property-other-people-also-viewed">
<h4><?php
_e('Other people also viewed', THEME_NAME);
?>
</h4>
<?php
echo PropertiesManager::getOtherPeopleAlsoViewedHTML($post);
?>
</div>
<?php
}
?>
<?php
if (estetico_get_setting('show_recently_viewed') == 'yes') {
$options = array('exclude' => $property->getId());
if (PropertiesManager::hasRecentlyViewed($options)) {
?>
<div class="property-viewed property-recently-viewed">
<h4><?php
_e('Recently viewed', THEME_NAME);
?>
</h4>
<?php
echo PropertiesManager::getRecentlyViewedHTML($options);
?>
</div>
<?php
}
}
?>