本文整理汇总了PHP中Country::getId方法的典型用法代码示例。如果您正苦于以下问题:PHP Country::getId方法的具体用法?PHP Country::getId怎么用?PHP Country::getId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Country
的用法示例。
在下文中一共展示了Country::getId方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ensureConsistency
/**
* Checks and repairs the internal consistency of the object.
*
* This method is executed after an already-instantiated object is re-hydrated
* from the database. It exists to check any foreign keys to make sure that
* the objects related to the current object are correct based on foreign key.
*
* You can override this method in the stub class, but you should always invoke
* the base method from the overridden method (i.e. parent::ensureConsistency()),
* in case your model changes.
*
* @throws PropelException
*/
public function ensureConsistency()
{
if ($this->aCountry !== null && $this->default_country_id !== $this->aCountry->getId()) {
$this->aCountry = null;
}
if ($this->aCurrency !== null && $this->default_currency_id !== $this->aCurrency->getId()) {
$this->aCurrency = null;
}
}
示例2: getCountries
/**
*
* @return multitype:Country creates an array of all the data a country has.
*/
public static function getCountries()
{
$countries = array();
$country = new Country();
$country->setId(1);
$country->setName('America');
$countries[$country->getId()] = $country;
$country2 = new Country();
$country2->setId(2);
$country2->setname('Germany');
$countries[$country2->getId()] = $country2;
return $countries;
}
示例3: prune
/**
* Exclude object from result
*
* @param Country $country Object to remove from the list of results
*
* @return CountryQuery The current query, for fluid interface
*/
public function prune($country = null)
{
if ($country) {
$this->addUsingAlias(CountryPeer::ID, $country->getId(), Criteria::NOT_EQUAL);
}
return $this;
}
示例4: ensureConsistency
/**
* Checks and repairs the internal consistency of the object.
*
* This method is executed after an already-instantiated object is re-hydrated
* from the database. It exists to check any foreign keys to make sure that
* the objects related to the current object are correct based on foreign key.
*
* You can override this method in the stub class, but you should always invoke
* the base method from the overridden method (i.e. parent::ensureConsistency()),
* in case your model changes.
*
* @throws PropelException
*/
public function ensureConsistency()
{
if ($this->aCustomerTitle !== null && $this->title_id !== $this->aCustomerTitle->getId()) {
$this->aCustomerTitle = null;
}
if ($this->aCountry !== null && $this->country_id !== $this->aCountry->getId()) {
$this->aCountry = null;
}
}
示例5: testGetSetId
public function testGetSetId()
{
$this->country->setId('GBR');
$this->assertEquals('GBR', $this->country->getId());
}
示例6: 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 Country $obj A Country 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
self::$instances[$key] = $obj;
}
}
示例7: assertPreConditions
protected function assertPreConditions()
{
$this->assertInstanceOf('JLM\\DailyBundle\\Model\\PartFamilyInterface', $this->entity);
$this->assertNull($this->entity->getId());
$this->assertNull($this->entity->getName());
}
示例8: setCountry
/**
* Declares an association between this object and a Country object.
*
* @param Country $v
* @return State The current object (for fluent API support)
* @throws PropelException
*/
public function setCountry(Country $v = null)
{
if ($v === null) {
$this->setCountryId(NULL);
} else {
$this->setCountryId($v->getId());
}
$this->aCountry = $v;
// Add binding for other direction of this n:n relationship.
// If this object has already been added to the Country object, it will not be re-added.
if ($v !== null) {
$v->addState($this);
}
return $this;
}
示例9: assertPreConditions
/**
* {@inheritdoc}
*/
protected function assertPreConditions()
{
$this->assertInstanceOf('JLM\\ContractBundle\\Model\\ContractInterface', $this->entity);
$this->assertNull($this->entity->getId());
}
示例10: ensureConsistency
/**
* Checks and repairs the internal consistency of the object.
*
* This method is executed after an already-instantiated object is re-hydrated
* from the database. It exists to check any foreign keys to make sure that
* the objects related to the current object are correct based on foreign key.
*
* You can override this method in the stub class, but you should always invoke
* the base method from the overridden method (i.e. parent::ensureConsistency()),
* in case your model changes.
*
* @throws PropelException
*/
public function ensureConsistency()
{
if ($this->aCountry !== null && $this->country_id !== $this->aCountry->getId()) {
$this->aCountry = null;
}
}